cc68a136 |
1 | # settings |
d08e7326 |
2 | #use_fbdev = 1 |
3 | #fake_in_gp2x = 1 |
4 | |
d26dc685 |
5 | use_musashi = 1 |
6 | #use_fame = 1 |
f0d7b1fa |
7 | use_cz80 = 1 |
679af8a3 |
8 | use_sh2drc = 1 |
f0d7b1fa |
9 | #use_sh2mame = 1 |
10 | |
80599a42 |
11 | #drc_debug = 3 |
f0d7b1fa |
12 | #drc_debug_interp = 1 |
1fb0dd88 |
13 | #profile = 1 |
cc68a136 |
14 | |
5686d931 |
15 | all: mkdirs PicoDrive |
16 | |
19e1d027 |
17 | -include Makefile.local |
cc68a136 |
18 | |
65c75cb0 |
19 | ifndef ARCH |
20 | ARCH = x86 |
21 | endif |
22 | |
bcd94522 |
23 | DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV |
697746df |
24 | CFLAGS += -ggdb -Wall -falign-functions=2 |
19e1d027 |
25 | CFLAGS += -I../.. -I. |
553c3eaa |
26 | LDFLAGS += -lm -lpng |
65c75cb0 |
27 | ifeq "$(ARCH)" "arm" |
28 | CFLAGS += -mcpu=arm920t |
29 | DEFINES += ARM |
65c75cb0 |
30 | endif |
31 | |
5686d931 |
32 | CC ?= $(CROSS)gcc |
cc68a136 |
33 | |
34 | # frontend |
697746df |
35 | OBJS += io.o emu.o blit.o in_evdev.o plat.o sndout_oss.o log_io.o |
e5f426aa |
36 | |
37 | # common |
bcd94522 |
38 | OBJS += platform/common/main.o platform/common/emu.o platform/common/menu.o \ |
39 | platform/common/config.o platform/common/fonts.o platform/common/readpng.o \ |
40 | platform/common/input.o |
e5f426aa |
41 | |
d08e7326 |
42 | ifeq "$(use_fbdev)" "1" |
43 | DEFINES += FBDEV |
44 | OBJS += fbdev.o |
45 | else |
46 | LDFLAGS += -lpthread |
47 | LDFLAGS += -lX11 |
48 | endif |
49 | |
19e1d027 |
50 | ifeq "$(fake_in_gp2x)" "1" |
51 | DEFINES += IN_GP2X FAKE_IN_GP2X |
52 | OBJS += platform/gp2x/in_gp2x.o |
697746df |
53 | DIRS += platform/gp2x |
19e1d027 |
54 | endif |
55 | |
65c75cb0 |
56 | ifeq "$(ARCH)" "arm" |
57 | OBJS += pico/carthw/svp/stub_arm.o |
58 | endif |
697746df |
59 | OBJS += pico/sound/mix.o |
60 | OBJS += pico/carthw/svp/compiler.o |
61 | |
cc68a136 |
62 | # zlib |
2445b7cb |
63 | OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ |
71de3cd9 |
64 | zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o |
cc68a136 |
65 | # unzip |
2445b7cb |
66 | OBJS += unzip/unzip.o unzip/unzip_stream.o |
cc68a136 |
67 | |
2445b7cb |
68 | vpath %.c = ../.. |
65c75cb0 |
69 | vpath %.s = ../.. |
70 | vpath %.S = ../.. |
679af8a3 |
71 | vpath %.asm = ../.. |
19e1d027 |
72 | |
e05b81fc |
73 | DIRS += platform/linux zlib unzip |
cc68a136 |
74 | |
f0d7b1fa |
75 | include ../common/common.mak |
697746df |
76 | include ../common/revision.mak |
77 | |
78 | CFLAGS += $(addprefix -D,$(DEFINES)) |
f0d7b1fa |
79 | |
cc68a136 |
80 | clean: tidy |
81 | @$(RM) PicoDrive |
82 | tidy: |
2445b7cb |
83 | $(RM) $(OBJS) |
84 | rm -rf $(DIRS) |
cc68a136 |
85 | @make -C ../../cpu/mz80/ clean |
86 | |
94d2199e |
87 | PicoDrive : $(OBJS) |
03e4f2a3 |
88 | @echo ">>>" $@ |
553c3eaa |
89 | $(CC) $(CFLAGS) $^ $(LDFLAGS) -Wl,-Map=PicoDrive.map -o $@ |
cc68a136 |
90 | |
f6c49d38 |
91 | pprof: pprof.c |
25eb407c |
92 | $(CROSS)gcc -O2 -ggdb -DPPROF -DPPROF_TOOL -I../../ -I. $^ -o $@ |
f6c49d38 |
93 | |
679af8a3 |
94 | %.o : %.asm |
95 | @echo ">>>" $< |
96 | nasm -f elf $< -o $@ |
cc68a136 |
97 | |