Added detection for the unsigned/signed short type
[clinton/Virtual-Jaguar-Rx.git] / src / m68000 / Makefile
CommitLineData
cf76e892
JPM
1#
2# Makefile for modified UAE 68000 CPU core
3#
4# by James Hammons
5# (C) 2011 Underground Software
6#
7# This makefile is released under the GPLv3 or later
8#
9
10ifeq ("$(V)","1")
11Q :=
12else
13Q := @
14endif
15
16# Cross compilation using MXE
17CROSS = i686-pc-mingw32-
18#CROSS = i686-w64-mingw32-
19#CROSS = x86_64-pc-msys-
20
21CC := $(CROSS)gcc
22LD := $(CROSS)gcc
23AR := $(CROSS)ar
24HOSTCC := gcc
25
26ARFLAGS := -rs
27GCC_DEPS = -MMD
28INCS := -I. -I./obj `$(CROSS)sdl-config --cflags`
29
30OBJS = \
31 obj/cpustbl.o \
32 obj/cpudefs.o \
33 obj/cpuemu.o \
34 obj/cpuextra.o \
35 obj/readcpu.o \
36 obj/m68kinterface.o \
37 obj/m68kdasm.o
38
39# Targets for convenience sake, not "real" targets
40.PHONY: clean
41
42all: obj obj/libm68k.a
43 @echo "Done!"
44
45# Library rules (might not be cross-platform compatible)
46obj/libm68k.a: $(OBJS)
47 $(Q)$(AR) $(ARFLAGS) obj/libm68k.a $(OBJS)
48
49obj:
50 @mkdir ./obj
51
52# Main source compilation (implicit rules)...
53
54obj/%.o: %.c
55 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
56 $(Q)$(CC) $(GCC_DEPS) $(CFLAGS) $(INCS) -c $< -o $@
57
58obj/%.o: obj/%.c
59 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
60 $(Q)$(CC) $(GCC_DEPS) $(CFLAGS) $(INCS) -c $< -o $@
61
62# Generated code
63
64obj/cpuemu.c: obj/gencpu
65obj/cpustbl.c: obj/gencpu
66 @echo -e "\033[01;33m***\033[00;32m Generating cpuemu.c...\033[00m"
67 @cd obj && ./gencpu
68
69obj/gencpu: obj/cpudefs.c
70 @echo -e "\033[01;33m***\033[00;32m Generating gencpu...\033[00m"
71 $(Q)$(HOSTCC) $(GCC_DEPS) $(CFLAGS) gencpu.c readcpu.c obj/cpudefs.c -o obj/gencpu -I. -I./obj
72
73obj/cpudefs.c: obj/build68k
74 @echo -e "\033[01;33m***\033[00;32m Generating cpudefs.c...\033[00m"
75 $(Q)obj/build68k < table68k > obj/cpudefs.c
76
77obj/build68k: build68k.c
78 @echo -e "\033[01;33m***\033[00;32m Compiling $< ...\033[00m"
79 $(Q)$(HOSTCC) $(GCC_DEPS) $(CFLAGS) build68k.c -o obj/build68k
80
81clean:
82 @echo -ne "\033[01;33m***\033[00;32m Cleaning out the garbage...\033[00m"
83 @-rm -rf ./obj
84 @echo "done!"
85
86# Pull in dependencies autogenerated by gcc's -MMD switch
87# The "-" in front is there just in case they haven't been created yet
88
89-include obj/*.d