summaryrefslogtreecommitdiff
path: root/compile/win32
diff options
context:
space:
mode:
Diffstat (limited to 'compile/win32')
-rw-r--r--compile/win32/Makefile30
1 files changed, 26 insertions, 4 deletions
diff --git a/compile/win32/Makefile b/compile/win32/Makefile
index 2938ad2..4359413 100644
--- a/compile/win32/Makefile
+++ b/compile/win32/Makefile
@@ -11,7 +11,7 @@ INCLUDES = -I../../includes -I../../psxdev -I../../generic/include \
-I/usr/local/cross-tools/i386-mingw32msvc/include/SDL \
-I../..
-CPPFLAGS = $(INCLUDES) -O4 -march=i686 -DSTDC_HEADERS -DREADLINE_STATIC
+CPPFLAGS = $(INCLUDES) -O4 -march=i686 -DSTDC_HEADERS -DREADLINE_STATIC -fexceptions
LDFLAGS = -march=i586 -O4
@@ -70,7 +70,7 @@ LUA_SOURCES = \
PSX_SOURCES = \
../../lib/cdabstract.cpp ../../lib/luacd.cpp \
../../lib/cdreader.cpp ../../lib/luapsx.cpp \
-../../lib/cdutils.cpp ../../lib/lzss.cpp \
+../../lib/cdutils.cpp \
../../lib/yazedc.cpp ../../lib/isobuilder.cpp
PSXDEV_SOURCES = \
@@ -91,11 +91,15 @@ WHOLE_SOURCES = $(SOURCES) $(COMMON_SOURCES) $(MOGLTK_SOURCES)
ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES))))
+ALL_DEP = $(addsuffix .dep, $(notdir $(basename $(WHOLE_SOURCES))))
+
DALOS_OBJECTS = $(addsuffix .o, $(notdir $(basename $(COMMON_SOURCES) $(MOGLTK_SOURCES)))) Dalos.o
CD_TOOL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(COMMON_SOURCES)))) cd-tool.o
-all: cd-tool.exe Dalos.exe
+CD_TOOL_DEP = $(addsuffix .dep, $(notdir $(basename $(COMMON_SOURCES)))) cd-tool.o
+
+all: dep cd-tool.exe Dalos.exe
stats:
@wc $(WHOLE_SOURCES)
@@ -116,19 +120,37 @@ cd-tool.exe: $(CD_TOOL_OBJECTS)
upx-nrv -9 cd-tool.exe
clean:
- rm -f *.exe *.o
+ rm -f *.exe *.o *.dep
+dep: $(ALL_DEP)
+source: dep $(COMMON_SOURCES) ../../cd-tool.cpp
+ for s in $(COMMON_SOURCES) ../../cd-tool.cpp ; do \
+ depfile=$${s/*\//} ; \
+ depfile=$${depfile/\.*/}.dep ; \
+ for f in `cat $$depfile | sed 's/\\\\//g' | tr \\ '\\012' | grep -v ^$$ | grep -v :` $$s; do \
+ install -D $$f tmp/`echo $$f | sed 's/\.\.\/\.\.\///'` ; \
+ done ; \
+ done
+ (cd tmp ; zip -r9 ../../cd-tool-`date +%Y%m%d`-win32-fullsrc.zip .)
+ rm -rf tmp
+-include $(ALL_OBJECTS:.o=.dep)
define OBJECT_C_template
$(addsuffix .o, $(notdir $(basename $(1)))): $(src)
$$(CC) $$(CPPFLAGS) $$(CFLAGS) -c $(src)
+
+ $(addsuffix .dep, $(notdir $(basename $(1)))): $(src)
+ $$(CC) $$(CPPFLAGS) $$(CFLAGS) -MM $(src) -o $$@
endef
define OBJECT_CXX_template
$(addsuffix .o, $(notdir $(basename $(1)))): $(src)
$$(CXX) $$(CPPFLAGS) $$(CXXFLAGS) -c $(src)
+
+ $(addsuffix .dep, $(notdir $(basename $(1)))): $(src)
+ $$(CXX) $$(CPPFLAGS) $$(CXXFLAGS) -MM $(src) -o $$@
endef
$(foreach src, $(WHOLE_SOURCES), $(if $(filter %.c, $(src)), $(eval $(call OBJECT_C_template, $(src))), $(eval $(call OBJECT_CXX_template, $(src)))))