2 # Makefile for modified UAE 68000 CPU core
5 # (C) 2011 Underground Software
7 # This makefile is released under the GPLv3 or later
15 # Note that we use optimization level 2 instead of 3--3 doesn't seem to gain much over 2
16 CFLAGS := -MMD -O2 -ffast-math -fomit-frame-pointer
18 INCS := -I. -I./obj `sdl-config --cflags`
31 # Targets for convenience sake, not "real" targets
34 all: obj obj/libm68k.a
37 # Library rules (might not be cross-platform compatible)
38 obj/libm68k.a: $(OBJS)
39 @$(AR) $(ARFLAGS) obj/libm68k.a $(OBJS)
44 # Main source compilation (implicit rules)...
47 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
48 @$(CC) $(CFLAGS) $(INCS) -c $< -o $@
51 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
52 @$(CC) $(CFLAGS) $(INCS) -c $< -o $@
56 obj/cpuemu.c: obj/gencpu
57 obj/cpustbl.c: obj/gencpu
58 @echo -e "\033[01;33m***\033[00;32m Generating cpuemu.c...\033[00m"
61 obj/gencpu: obj/cpudefs.c
62 @echo -e "\033[01;33m***\033[00;32m Generating gencpu...\033[00m"
63 @$(CC) $(CFLAGS) gencpu.c readcpu.c obj/cpudefs.c -o obj/gencpu -I. -I./obj
65 obj/cpudefs.c: obj/build68k
66 @echo -e "\033[01;33m***\033[00;32m Generating cpudefs.c...\033[00m"
67 @obj/build68k < table68k > obj/cpudefs.c
69 obj/build68k: build68k.c
70 @echo -e "\033[01;33m***\033[00;32m Compiling build68k.c...\033[00m"
71 @$(CC) $(CFLAGS) build68k.c -o obj/build68k
74 @echo -ne "\033[01;33m***\033[00;32m Cleaning out the garbage...\033[00m"
76 # @-$(FIND) . -name "*~" -exec rm -f {} \;
79 # Pull in dependencies autogenerated by gcc's -MMD switch
80 # The "-" in front is there just in case they haven't been created yet