-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
44 lines (31 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
musashi_dir = external/Musashi
musashi_objects = $(musashi_dir)/m68kcpu.o $(musashi_dir)/m68kdasm.o $(musashi_dir)/m68kops.o
shim_objects = lib/musashi-c-wrapper/shim.o
all: help
help:
@echo ""
@echo "make morfe - build 65c816-only version"
@echo "make morfe-m68k - build emulator with additional m68k support"
@echo "make clean - clean-up binaries"
@echo "make clean-all - clean-up binaries and object files"
$(musashi_dir):
@echo "attempting to clone Musashi into $(musashi_dir)"
git clone https://github.com/kstenerud/Musashi/ $(musashi_dir)
$(musashi_objects): lib/musashi-c-wrapper/m68kconf.h
cp -vf $? $(musashi_dir)/
$(MAKE) -C $(musashi_dir) clean
$(MAKE) -C $(musashi_dir)
$(shim_objects): lib/musashi-c-wrapper/shim.c
$(CC) -std=c99 -I $(musashi_dir) -Wall -c $< -o $@
morfe-m68k: $(musashi_dir) $(musashi_objects) $(shim_objects)
CGO_LDFLAGS_ALLOW=".+/(Musashi|musashi-c-wrapper)/.+\.o" \
go build --tags musashi -o $@ cmd/morfe/*.go
@echo "type ./$(@) conf/a2560k.ini to run"
morfe:
go build -o $@ cmd/morfe/*.go
@echo "type ./$(@) conf/c256.ini to run"
clean:
rm -fv morfe morfe-m68k
clean-all: $(musashi_objects) $(shim_objects)
rm -fv $^
.PHONY: all help morfe morfe-m68k