bugfix
[picodrive.git] / platform / win32 / Makefile
CommitLineData
823b9004 1# settings
2CROSS=i586-mingw32msvc-
3
4#use_musashi = 1
5use_fame = 1
6#use_mz80 = 1
7
8-include Makefile.local
9
10CC = $(CROSS)gcc
11CXX = $(CROSS)g++
12LD = $(CROSS)ld
13STRIP = $(CROSS)strip
14
15DEFINES = _UNZIP_SUPPORT IN_VK
16CFLAGS += -O2 -Wall -falign-functions=2 -ffast-math
17CFLAGS += -I../.. -I. -I../../zlib/ -Idirectx/include/
ba86b61e 18LDFLAGS += -mwindows -L. -Ldirectx/lib/ -lgdi32 -lcomdlg32 -lddraw -ldsound -ldxguid
823b9004 19
20# frontend
21OBJS += main.o plat.o direct.o dsnd.o in_vk.o
22
23# common
24OBJS += platform/common/emu.o platform/common/menu.o \
25 platform/common/config.o platform/common/fonts.o platform/common/readpng.o \
26 platform/common/input.o
27
28# Pico
29OBJS += pico/area.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o \
30 pico/videoport.o pico/draw2.o pico/draw.o pico/z80if.o pico/patch.o \
31 pico/mode4.o pico/sms.o pico/misc.o pico/eeprom.o pico/debug.o
32# Pico - CD
33OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \
34 pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \
35 pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o
36# Pico - 32X
37OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o
38# Pico - Pico
39OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o
40# Pico - sound
41OBJS += pico/sound/sound.o pico/sound/sn76496.o pico/sound/ym2612.o pico/sound/mix.o
42# Pico - carthw
43OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \
44 pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o
45# zlib
46OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
47 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
48# unzip
49OBJS += unzip/unzip.o unzip/unzip_stream.o
50# CPU cores
51ifeq "$(use_musashi)" "1"
52DEFINES += EMU_M68K
53OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
54#OBJS += cpu/musashi/m68kdasm.o
55endif
56ifeq "$(use_fame)" "1"
57DEFINES += EMU_F68K
58OBJS += cpu/fame/famec.o
59endif
60# z80
61ifeq "$(use_mz80)" "1"
62DEFINES += _USE_MZ80
63OBJS += cpu/mz80/mz80.o
64else
65DEFINES += _USE_CZ80
66OBJS += cpu/cz80/cz80.o
67endif
68# sh2
69OBJS += cpu/sh2mame/sh2pico.o
70# misc
71ifeq "$(use_fame)" "1"
72ifeq "$(use_musashi)" "1"
73OBJS += pico/debugCPU.o
74endif
75endif
76
77CFLAGS += $(addprefix -D,$(DEFINES))
78CXXFLAGS = $(CFLAGS)
79
80vpath %.c = ../..
81
82DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
83 pico/32x zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80 cpu/sh2mame
84
85TARGET = PicoDrive.exe
86
87all: mkdirs $(TARGET)
88clean: tidy
89 @$(RM) $(TARGET)
90tidy:
91 $(RM) $(OBJS) $(TARGET).map
92 rm -rf $(DIRS)
93
94$(TARGET) : $(OBJS)
95 @echo ">>>" $@
96 $(CC) $(CFLAGS) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=$(TARGET).map -o $@
97 $(STRIP) $@
98
99mkdirs:
100 @mkdir -p $(DIRS)
101
102include ../common/revision.mak
103
104pico/carthw/svp/compiler.o : ../../pico/carthw/svp/gen_arm.c
105pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
106pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
107
108../../cpu/musashi/m68kops.c :
109 @make -C ../../cpu/musashi
110
111cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm
112 @echo $@
113 @nasm -f elf $< -o $@
114
115../../cpu/mz80/mz80.asm :
116 @make -C ../../cpu/mz80/
117
118.c.o:
119 @echo ">>>" $<
120 $(CC) $(CFLAGS) -c $< -o $@
121.s.o:
122 @echo ">>>" $<
123 $(CC) $(CFLAGS) -c $< -o $@
124
125
126cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
127 @echo ">>>" $<
128 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@
129
81aaab49 130# ----------- release -----------
131ifneq ($(findstring rel,$(MAKECMDGOALS)),)
132ifeq ($(VER),)
133$(error need VER)
134endif
135endif
136
137rel: $(TARGET) readme.txt carthw.cfg
138 zip -9 -j ../../PicoDrive_win32_$(VER).zip $^
139