| 1 | # settings |
| 2 | CROSS=i586-mingw32msvc- |
| 3 | |
| 4 | #use_musashi = 1 |
| 5 | use_fame = 1 |
| 6 | use_cz80 = 1 |
| 7 | use_sh2drc = 1 |
| 8 | #use_sh2mame = 1 |
| 9 | |
| 10 | -include Makefile.local |
| 11 | |
| 12 | ARCH ?= x86 |
| 13 | CC = $(CROSS)gcc |
| 14 | CXX = $(CROSS)g++ |
| 15 | LD = $(CROSS)ld |
| 16 | STRIP = $(CROSS)strip |
| 17 | |
| 18 | DEFINES = _UNZIP_SUPPORT IN_VK |
| 19 | CFLAGS += -O2 -Wall -falign-functions=2 -ffast-math |
| 20 | CFLAGS += -I../.. -I. -I../../zlib/ -Idirectx/include/ |
| 21 | LDFLAGS += -mwindows -L. -Ldirectx/lib/ -lgdi32 -lcomdlg32 -lddraw -ldsound -ldxguid |
| 22 | |
| 23 | # frontend |
| 24 | OBJS += main.o plat.o direct.o dsnd.o in_vk.o |
| 25 | |
| 26 | # common |
| 27 | OBJS += platform/common/emu.o platform/common/menu.o \ |
| 28 | platform/common/config.o platform/common/fonts.o platform/common/readpng.o \ |
| 29 | platform/common/input.o |
| 30 | |
| 31 | OBJS += pico/carthw/svp/compiler.o |
| 32 | OBJS += pico/sound/mix.o |
| 33 | # zlib |
| 34 | OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ |
| 35 | zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o |
| 36 | # unzip |
| 37 | OBJS += unzip/unzip.o unzip/unzip_stream.o |
| 38 | |
| 39 | CFLAGS += $(addprefix -D,$(DEFINES)) |
| 40 | CXXFLAGS = $(CFLAGS) |
| 41 | |
| 42 | vpath %.c = ../.. |
| 43 | |
| 44 | DIRS += zlib unzip |
| 45 | |
| 46 | TARGET = PicoDrive.exe |
| 47 | all: mkdirs $(TARGET) |
| 48 | |
| 49 | include ../common/common.mak |
| 50 | include ../common/revision.mak |
| 51 | |
| 52 | clean: tidy |
| 53 | @$(RM) $(TARGET) |
| 54 | tidy: |
| 55 | $(RM) $(OBJS) $(TARGET).map |
| 56 | rm -rf $(DIRS) |
| 57 | |
| 58 | $(TARGET) : $(OBJS) |
| 59 | @echo ">>>" $@ |
| 60 | $(CC) $(CFLAGS) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=$(TARGET).map -o $@ |
| 61 | $(STRIP) $@ |
| 62 | |
| 63 | # ----------- release ----------- |
| 64 | ifneq ($(findstring rel,$(MAKECMDGOALS)),) |
| 65 | ifeq ($(VER),) |
| 66 | $(error need VER) |
| 67 | endif |
| 68 | endif |
| 69 | |
| 70 | rel: $(TARGET) readme.txt carthw.cfg |
| 71 | zip -9 -j ../../PicoDrive_win32_$(VER).zip $^ |
| 72 | |