summaryrefslogtreecommitdiff
path: root/compile/win32/Makefile
blob: f1f35c1c6fdee4c6613aa114ced4e2592d93eea5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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../../generic/lib/zlib/include \
-I../../generic/lib/lua/include -I../../generic/lib/lua/includes \
-I../../mogltk/include \
-I../../MSVC/regex -I../../MSVC/readline -I../../MSVC/getopt -I../../MSVC \
-I../..

CPPFLAGS = $(INCLUDES) -march=i686 -DSTDC_HEADERS -DREADLINE_STATIC -fexceptions

LDFLAGS = -O4 `sdl-config --libs`

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

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 = \
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 = \
adler32.c   inffast.c \
compress.c  inflate.c \
crc32.c     inftrees.c \
deflate.c   \
gzio.c      trees.c \
uncompr.c \
zutil.c

LUA_SOURCES = \
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 = \
cdabstract.cpp  luacd.cpp  \
cdreader.cpp    luapsx.cpp \
cdutils.cpp     lzss.cpp   \
yazedc.cpp      isobuilder.cpp \
dvdabstract.cpp

PSXDEV_SOURCES = \
bs.c       jfdctint.c  xadecode.c \
idctfst.c  vlc.c

REGEX_SOURCES = msvc-regex.c

GETOPT_SOURCES = getopt.c 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_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

all: dep cd-tool.exe

dep: $(ALL_DEPS)

#stats:
#	@wc $(WHOLE_SOURCES)

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

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) -o cd-tool.exe $(CD_TOOL_OBJECTS) ../../libreadline-static.a -mconsole
	$(STRIP) cd-tool.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 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)