2 # Makefile for modified UAE 68000 CPU core
5 # (C) 2011 Underground Software
7 # This makefile is released under the GPLv3 or later
16 # Cross compilation using MXE
17 #CROSS = i686-pc-mingw32-
26 INCS := -I. -I./obj `$(CROSS)sdl-config --cflags`
37 # Targets for convenience sake, not "real" targets
40 all: obj obj/libm68k.a
43 # Library rules (might not be cross-platform compatible)
44 obj/libm68k.a: $(OBJS)
45 $(Q)$(AR) $(ARFLAGS) obj/libm68k.a $(OBJS)
50 # Main source compilation (implicit rules)...
53 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
54 $(Q)$(CC) $(GCC_DEPS) $(CFLAGS) $(INCS) -c $< -o $@
57 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
58 $(Q)$(CC) $(GCC_DEPS) $(CFLAGS) $(INCS) -c $< -o $@
62 obj/cpuemu.c: obj/gencpu
63 obj/cpustbl.c: obj/gencpu
64 @echo -e "\033[01;33m***\033[00;32m Generating cpuemu.c...\033[00m"
67 obj/gencpu: obj/cpudefs.c
68 @echo -e "\033[01;33m***\033[00;32m Generating gencpu...\033[00m"
69 $(Q)$(HOSTCC) $(GCC_DEPS) $(CFLAGS) gencpu.c readcpu.c obj/cpudefs.c -o obj/gencpu -I. -I./obj
71 obj/cpudefs.c: obj/build68k
72 @echo -e "\033[01;33m***\033[00;32m Generating cpudefs.c...\033[00m"
73 $(Q)obj/build68k < table68k > obj/cpudefs.c
75 obj/build68k: build68k.c
76 @echo -e "\033[01;33m***\033[00;32m Compiling $< ...\033[00m"
77 $(Q)$(HOSTCC) $(GCC_DEPS) $(CFLAGS) build68k.c -o obj/build68k
80 @echo -ne "\033[01;33m***\033[00;32m Cleaning out the garbage...\033[00m"
84 # Pull in dependencies autogenerated by gcc's -MMD switch
85 # The "-" in front is there just in case they haven't been created yet