summaryrefslogtreecommitdiff
path: root/Makefile
blob: 2d71ef1fa77e42df6cb00755d6b01df92b8a7296 (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
#!/usr/bin/make -f

CPPFLAGS=-Wall -g -O3 -mcpu=i686 -Iincludes `sdl-config --cflags` -DHAVE_ZLIB `baltisot-config --cflags` `lua-config --include` -DCHATTING
LDFLAGS=-lz `sdl-config --libs` `baltisot-config --libs` -lefence
CDTOOL_LDFLAGS=`baltisot-config --libs` -lreadline -g
CXX=g++

#SUBDIRS = psxdev lib Xenogears VP MegamanX5
SUBDIRS = psxdev lib PE Xenogears
TARGET = lzss dlzss cd-tool str-player crypto-search bgrep tile-convert mipspoke bin2c

all: subdirs ${TARGET}

subdirs:
	for d in ${SUBDIRS} ; do make -C $$d || exit -1 ; done

lzss: includes/lzss.h lzss-main.o lib/lib.a Makefile
	${CXX} -DLZSS_MAIN lzss-main.o lib/lib.a -o lzss ${LDFLAGS}

dlzss: lzss Makefile
	ln -fs lzss dlzss

yazedc: yazedc-main.o lib/lib.a Makefile
	${CXX} yazedc-main.o lib/lib.a -DYAZEDC_MAIN -o yazedc ${LDFLAGS}

cd-tool.o: cd-tool.cpp cd-tool-hc.h

cd-tool-hc.h: bin2c cd-tool.bin
	./bin2c cd-tool.bin cd-tool-hc.h cd_tool_lua

cd-tool.bin: cd-tool.lua
	luac -s -o cd-tool.bin cd-tool.lua

cd-tool: includes/cdutils.h includes/yazedc.h cd-tool.o lib/lib.a psxdev/psxdev.a Makefile
	${CXX} cd-tool.o lib/lib.a psxdev/psxdev.a -o cd-tool ${CDTOOL_LDFLAGS}

dte-tool: includes/dte.h dtemain.o lib/lib.a Makefile
	${CXX} dtemain.o lib/lib.a -o dte-tool ${LDFLAGS}

str-player: str-player.o includes/cdutils.h includes/yazedc.h lib/lib.a psxdev/psxdev.a Makefile
	${CXX} str-player.o psxdev/psxdev.a lib/lib.a -o str-player ${LDFLAGS}

crypto-search: crypto-search.o lib/lib.a Makefile
	${CXX} crypto-search.o lib/lib.a -o crypto-search ${LDFLAGS}

mipspoke: mipspoke.o lib/lib.a Makefile
	${CXX} mipspoke.o lib/lib.a -o mipspoke ${LDFLAGS}

bgrep: bgrep.o Makefile
	${CXX} bgrep.o -o bgrep ${LDFLAGS}

tile-convert: tile-convert.o Makefile
	${CXX} tile-convert.o -o tile-convert ${LDFLAGS}

bin2c: bin2c.o Makefile
	${CXX} bin2c.o -o bin2c ${LDFLAGS}

clean:
	for d in ${SUBDIRS} ; do make -C $$d clean || exit -1 ; done
	rm -f *.o ${TARGET} compil.c cd-tool-hc.h cd-tool.bin