source: buchla-emu/Makefile@ d54045b

Last change on this file since d54045b was d54045b, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Skeleton compiles.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1FLAGS := -std=c99 -O2 -gdwarf-4
2
3FLAGS_CPU := $(FLAGS) -I cpu -I build
4
5FLAGS_EMU := $(FLAGS) \
6 -fno-strict-aliasing -fno-inline -fno-omit-frame-pointer \
7 -Wall -Wextra \
8 -Wpedantic -Wconversion -Wsign-conversion -Wshadow \
9 -Wstrict-prototypes -Wmissing-declarations -Wredundant-decls \
10 -I cpu -I emu -I build
11
12FLAGS_LNK := $(FLAGS) -Wall -Wextra
13
14HEADERS := $(wildcard cpu/*.h) $(wildcard emu/*.h)
15
16all: buchla
17
18build:
19 mkdir build
20
21build/gen: | build
22 gcc $(FLAGS) -o build/gen cpu/m68kmake.c
23
24GEN_C := m68kopac.c m68kopdm.c m68kopnz.c m68kops.c
25GEN_H := m68kops.h
26
27GEN_CP := $(GEN_C:%=build/%)
28GEN_HP := $(GEN_H:%=build/%)
29
30GEN_O := $(GEN_C:.c=.o)
31GEN_OP := $(GEN_O:%=build/%)
32
33$(GEN_CP) $(GEN_HP): \
34 build/gen | build
35 cd cpu; ../build/gen ../build
36
37build/%.o: build/%.c $(HEADERS)
38 gcc $(FLAGS_CPU) -c -o $@ $<
39
40CPU_C := m68kcpu.c m68kdasm.c
41CPU_O := $(CPU_C:.c=.o)
42CPU_OP := $(CPU_O:%=build/%)
43
44build/%.o: cpu/%.c $(HEADERS) $(GEN_HP) | build
45 gcc $(FLAGS_CPU) -c -o $@ $<
46
47EMU_C := main.c
48EMU_O := $(EMU_C:.c=.o)
49EMU_OP := $(EMU_O:%=build/%)
50
51build/%.o: emu/%.c $(HEADERS) | build
52 gcc $(FLAGS_EMU) -c -o $@ $<
53
54buchla: $(CPU_OP) $(GEN_OP) $(EMU_OP)
55 gcc $(FLAGS_LNK) -o buchla $(CPU_OP) $(GEN_OP) $(EMU_OP)
56
57clean:
58 rm -rf build
59 rm -f buchla
Note: See TracBrowser for help on using the repository browser.