summaryrefslogtreecommitdiff
path: root/compile/win32
diff options
context:
space:
mode:
Diffstat (limited to 'compile/win32')
-rw-r--r--compile/win32/Makefile231
1 files changed, 107 insertions, 124 deletions
diff --git a/compile/win32/Makefile b/compile/win32/Makefile
index b5dd4b3..f1f35c1 100644
--- a/compile/win32/Makefile
+++ b/compile/win32/Makefile
@@ -1,170 +1,153 @@
-CC = i586-mingw32msvc-gcc
-CXX = i586-mingw32msvc-g++
-LD = i586-mingw32msvc-g++
-STRIP = i586-mingw32msvc-strip
+CC = i686-pc-mingw32-gcc
+CXX = i686-pc-mingw32-g++
+LD = i686-pc-mingw32-g++
+STRIP = i686-pc-mingw32-strip
-INCLUDES = -I../../includes -I../../psxdev -I../../generic/include \
--I../../MSVC/regex -I../../MSVC/readline -I../../MSVC/getopt -I../../MSVC \
+INCLUDES = \
+-I../../includes -I../../psxdev -I../../generic/include \
-I../../generic/lib/zlib/include \
-I../../generic/lib/lua/include -I../../generic/lib/lua/includes \
-I../../mogltk/include \
--I/usr/local/cross-tools/i386-mingw32msvc/include/SDL \
+-I../../MSVC/regex -I../../MSVC/readline -I../../MSVC/getopt -I../../MSVC \
-I../..
-CPPFLAGS = $(INCLUDES) -O4 -march=i686 -DSTDC_HEADERS -DREADLINE_STATIC -fexceptions
+CPPFLAGS = $(INCLUDES) -march=i686 -DSTDC_HEADERS -DREADLINE_STATIC -fexceptions
-LDFLAGS =
+LDFLAGS = -O4 `sdl-config --libs`
-SOURCES = \
-../../cd-tool.cpp ../../luapatch.cpp
+vpath %.c ../../Dalos:../../:../../mogltk/lib:../../generic/lib:../../lib:../../psxdev:../../generic/lib/zlib/src:../../generic/lib/lua/src:../../generic/lib/lua/src/LuaLib:../../MSVC/regex:../../MSVC/getopt
+vpath %.cc ../../Dalos:../../:../../mogltk/lib:../../generic/lib:../../lib:../../psxdev:../../generic/lib/zlib/src:../../generic/lib/lua/src:../../generic/lib/lua/src/LuaLib:../../MSVC/regex:../../MSVC/getopt
+vpath %.cpp ../../Dalos:../../:../../mogltk/lib:../../generic/lib:../../lib:../../psxdev:../../generic/lib/zlib/src:../../generic/lib/lua/src:../../generic/lib/lua/src/LuaLib:../../MSVC/regex:../../MSVC/getopt
-MOGLTK_SOURCES = \
-../../mogltk/lib/base.cc ../../mogltk/lib/glwidgets.cc \
-../../mogltk/lib/engine.cc ../../mogltk/lib/mcolor.cc \
-../../mogltk/lib/font.cc ../../mogltk/lib/shape.cc \
-../../mogltk/lib/glbase.cc ../../mogltk/lib/sprite.cc \
-../../mogltk/lib/glfont.cc ../../mogltk/lib/texture.cc \
-../../mogltk/lib/glshape.cc ../../mogltk/lib/widgets.cc \
-../../mogltk/lib/glsprite.cc
+SOURCES = \
+cd-tool.cpp
+#Dalos.cpp
+
+MOGLTK_SOURCES =
+#base.cc glwidgets.cc \
+#engine.cc mcolor.cc \
+#font.cc shape.cc \
+#glbase.cc sprite.cc \
+#glfont.cc texture.cc \
+#glshape.cc widgets.cc \
+#glsprite.cc
BALTISOT_SOURCES = \
-../../generic/lib/Image.cc ../../generic/lib/Main.cc \
-../../generic/lib/BLua.cc ../../generic/lib/Buffer.cc \
-../../generic/lib/ConfigFile.cc ../../generic/lib/Output.cc \
-../../generic/lib/Exceptions.cc ../../generic/lib/Regex.cc \
-../../generic/lib/Handle.cc ../../generic/lib/String.cc \
-../../generic/lib/Input.cc ../../generic/lib/fileutils.cc \
-../../generic/lib/LuaHandle.cc ../../generic/lib/generic.cc \
-../../generic/lib/checkargs.c ../../generic/lib/datecalc.c \
-../../generic/lib/LuaRegex.cc ../../generic/lib/LuaConfigFile.cc
+Image.cc Main.cc \
+BLua.cc Buffer.cc \
+ConfigFile.cc Output.cc \
+Exceptions.cc Regex.cc \
+Handle.cc String.cc \
+Input.cc fileutils.cc \
+LuaHandle.cc generic.cc \
+checkargs.c datecalc.c \
+LuaRegex.cc LuaConfigFile.cc
ZLIB_SOURCES = \
-../../generic/lib/zlib/src/adler32.c ../../generic/lib/zlib/src/inffast.c \
-../../generic/lib/zlib/src/compress.c ../../generic/lib/zlib/src/inflate.c \
-../../generic/lib/zlib/src/crc32.c ../../generic/lib/zlib/src/inftrees.c \
-../../generic/lib/zlib/src/deflate.c \
-../../generic/lib/zlib/src/gzio.c ../../generic/lib/zlib/src/trees.c \
-../../generic/lib/zlib/src/infblock.c ../../generic/lib/zlib/src/uncompr.c \
-../../generic/lib/zlib/src/zutil.c
+adler32.c inffast.c \
+compress.c inflate.c \
+crc32.c inftrees.c \
+deflate.c \
+gzio.c trees.c \
+uncompr.c \
+zutil.c
LUA_SOURCES = \
-../../generic/lib/lua/src/lapi.c ../../generic/lib/lua/src/lparser.c \
-../../generic/lib/lua/src/lcode.c ../../generic/lib/lua/src/lstate.c \
-../../generic/lib/lua/src/ldebug.c ../../generic/lib/lua/src/lstring.c \
-../../generic/lib/lua/src/ldo.c ../../generic/lib/lua/src/ltable.c \
-../../generic/lib/lua/src/ldump.c ../../generic/lib/lua/src/ltests.c \
-../../generic/lib/lua/src/lfunc.c ../../generic/lib/lua/src/ltm.c \
-../../generic/lib/lua/src/lgc.c ../../generic/lib/lua/src/luacomp.c \
-../../generic/lib/lua/src/llex.c ../../generic/lib/lua/src/lundump.c \
-../../generic/lib/lua/src/lmem.c ../../generic/lib/lua/src/lvm.c \
-../../generic/lib/lua/src/lobject.c ../../generic/lib/lua/src/lzio.c \
-../../generic/lib/lua/src/lopcodes.c \
-../../generic/lib/lua/src/LuaLib/lauxlib.c \
-../../generic/lib/lua/src/LuaLib/lbaselib.c \
-../../generic/lib/lua/src/LuaLib/ldblib.c \
-../../generic/lib/lua/src/LuaLib/liolib.c \
-../../generic/lib/lua/src/LuaLib/lmathlib.c \
-../../generic/lib/lua/src/LuaLib/loadlib.c \
-../../generic/lib/lua/src/LuaLib/lstrlib.c \
-../../generic/lib/lua/src/LuaLib/ltablib.c \
-../../generic/lib/lua/src/LuaLib/ldirlib.c
-
-HASH_SOURCES = \
-../../generic/lib/hashtab.c ../../generic/lib/lookupa.c \
-../../generic/lib/recycle.c
+lapi.c lparser.c \
+lcode.c lstate.c \
+ldebug.c lstring.c \
+ldo.c ltable.c \
+ldump.c ltests.c \
+lfunc.c ltm.c \
+lgc.c luacomp.c \
+llex.c lundump.c \
+lmem.c lvm.c \
+lobject.c lzio.c \
+lopcodes.c \
+lauxlib.c \
+lbaselib.c \
+ldblib.c \
+liolib.c \
+lmathlib.c \
+loadlib.c \
+lstrlib.c \
+ltablib.c \
+ldirlib.c
+
+#HASH_SOURCES = \
+#hashtab.c lookupa.c \
+#recycle.c
+HASH_SOURCES =
PSX_SOURCES = \
-../../lib/cdabstract.cpp ../../lib/luacd.cpp \
-../../lib/cdreader.cpp ../../lib/luapsx.cpp \
-../../lib/cdutils.cpp \
- ../../lib/yazedc.cpp ../../lib/isobuilder.cpp
+cdabstract.cpp luacd.cpp \
+cdreader.cpp luapsx.cpp \
+cdutils.cpp lzss.cpp \
+yazedc.cpp isobuilder.cpp \
+dvdabstract.cpp
PSXDEV_SOURCES = \
-../../psxdev/bs.c ../../psxdev/jfdctint.c ../../psxdev/xadecode.c \
-../../psxdev/idctfst.c ../../psxdev/vlc.c
+bs.c jfdctint.c xadecode.c \
+idctfst.c vlc.c
-REGEX_SOURCES = \
-../../MSVC/regex/msvc-regex.c
+REGEX_SOURCES = msvc-regex.c
+
+GETOPT_SOURCES = getopt.c getopt1.c
-GETOPT_SOURCES = \
-../../MSVC/getopt/getopt.c ../../MSVC/getopt/getopt1.c
COMMON_SOURCES = \
$(BALTISOT_SOURCES) $(ZLIB_SOURCES) $(REGEX_SOURCES) $(GETOPT_SOURCES) \
$(LUA_SOURCES) $(PSX_SOURCES) $(PSXDEV_SOURCES) $(READLINE_SOURCES) \
$(HASH_SOURCES)
+
WHOLE_SOURCES = $(SOURCES) $(COMMON_SOURCES) $(MOGLTK_SOURCES)
ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES))))
-
-ALL_DEP = $(addsuffix .dep, $(notdir $(basename $(WHOLE_SOURCES))))
+ALL_DEPS = $(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
-CD_TOOL_DEP = $(addsuffix .dep, $(notdir $(basename $(COMMON_SOURCES)))) cd-tool.dep
-
-LUAPATCH_OBJECTS = $(addsuffix .o, $(notdir $(basename $(COMMON_SOURCES)))) luapatch.o
+all: dep cd-tool.exe
-LUAPATCH_DEP = $(addsuffix .dep, $(notdir $(basename $(COMMON_SOURCES)))) luapatch.dep
+dep: $(ALL_DEPS)
-all: cd-tool.exe luapatch.exe
+#stats:
+# @wc $(WHOLE_SOURCES)
-stats:
- @wc $(WHOLE_SOURCES)
-
-dist: all ../../cd-tool.lua ../../COPYING ../../FAQ-cd.txt ../../README-LuaPatch.txt # README-SDL.txt SDL.dll
+dist: all ../../cd-tool.lua ../../COPYING ../../FAQ-cd.txt ../../README-LuaPatch.txt
zip -j9 ../cd-tool-`date +%Y%m%d`-win32.zip cd-tool.exe ../../cd-tool.lua ../../FAQ-cd.txt ../../COPYING
- #zip -j9 ../Dalos-`date +%Y%m%d`-win32.zip Dalos.exe ../../COPYING README-SDL.txt SDL.dll
- zip -j9 ../luapatch-`date +%Y%m%d`.zip luapatch.exe ../../FAQ-cd.txt ../../COPYING ../../README-LuaPatch.txt
-Dalos.exe: $(DALOS_OBJECTS)
- $(LD) $(LDFLAGS) -o Dalos.exe $(DALOS_OBJECTS) -lmingw32 -L/usr/local/cross-tools/i386-mingw32msvc/lib -lmingw32 -lSDLmain -lSDL -mwindows -lopengl32 -lglu32 ../../libreadline-static.a
- $(STRIP) Dalos.exe
- upx-nrv -9 Dalos.exe
- cat ../../Dalos/Dalos.paq >> Dalos.exe
+Dalos: $(DALOS_OBJECTS)
+ $(LD) -o Dalos $(DALOS_OBJECTS) -lGL -lGLU -lreadline -lSDL -lpthread
+ $(STRIP) Dalos
+
+Dalos-static: $(DALOS_OBJECTS)
+ $(LD) -o Dalos-static $(DALOS_OBJECTS) -lGL -lGLU -lreadline -lSDL -lpthread -static -laa -lgpm -lncurses -lX11 -lslang -lXext -ldl -lvga -lasound -L/usr/X11R6/lib
+ $(STRIP) Dalos-static
cd-tool.exe: $(CD_TOOL_OBJECTS)
- $(LD) $(LDFLAGS) -o cd-tool.exe $(CD_TOOL_OBJECTS) ../../libreadline-static.a -mconsole
+ $(LD) -o cd-tool.exe $(CD_TOOL_OBJECTS) ../../libreadline-static.a -mconsole
$(STRIP) cd-tool.exe
- upx-nrv -9 cd-tool.exe
-luapatch.exe: $(LUAPATCH_OBJECTS)
- i586-mingw32msvc-windres -I ../../ ../../luapatch.rc luapatch-res.o
- $(LD) $(LDFLAGS) -o luapatch.exe $(LUAPATCH_OBJECTS) luapatch-res.o -mconsole -lcomdlg32
- $(STRIP) luapatch.exe
- upx-nrv -9 luapatch.exe
+cd-tool-static: $(CD_TOOL_OBJECTS)
+ $(LD) $(LDFLAGS) -o cd-tool-static $(CD_TOOL_OBJECTS) -lreadline -lncurses -static
+ $(STRIP) cd-tool-static
clean:
- rm -f *.exe *.o *.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)))))
+ rm -f cd-tool.exe *.o *.dep
+
+
+%.dep : %.c
+ $(CC) $(CPPFLAGS) -M -MF $@ $<
+
+%.dep : %.cpp
+ $(CXX) $(CPPFLAGS) -M -MF $@ $<
+
+%.dep : %.cc
+ $(CXX) $(CPPFLAGS) -M -MF $@ $<
+
+
+-include $(ALL_DEPS)