1b318873272f93990c66ed8f537c76bbb3a4c88a
[projects/chimara/chimara.git] / babel / babel-makefile
1 # provisional makefile for babel\r
2 #\r
3 # Note that to compile babel, it is necessary only to compile all the .c\r
4 # files in this distribution and link them.\r
5 #\r
6 # This makefile is provided purely as a convenience.\r
7 #\r
8 # The following targets are available:\r
9 #  babel:               make babel\r
10 #  babel.lib:           make babel handler library (for Borland)\r
11 #  ifiction.lib:        make babel ifiction library (for Borland)\r
12 #  babel.a:             make babel handler library (for gcc)\r
13 #  ifiction.a:          make babel ifiction library (for gcc)\r
14 #  dist:                make babel.zip, the babel source distribution\r
15 #\r
16 # Note that this is a GNU makefile, and may not work with other makes\r
17 #\r
18 # Comment/uncomment the following lines to make the program work\r
19 \r
20 #CC=bcc32\r
21 #OBJ=.obj\r
22 #BABEL_LIB=babel.lib\r
23 #IFICTION_LIB=ifiction.lib\r
24 #BABEL_FLIB=babel_functions.lib\r
25 #OUTPUT_BABEL=\r
26 \r
27 CC=gcc -g\r
28 OBJ=.o\r
29 BABEL_LIB=babel.a\r
30 BABEL_FLIB=babel_functions.a\r
31 IFICTION_LIB=ifiction.a\r
32 OUTPUT_BABEL=-o babel\r
33 \r
34 treaty_objs = zcode${OBJ} magscrolls${OBJ} blorb${OBJ} glulx${OBJ} hugo${OBJ} agt${OBJ} level9${OBJ} executable${OBJ} advsys${OBJ} tads${OBJ} tads2${OBJ} tads3${OBJ} adrift${OBJ} alan${OBJ}\r
35 bh_objs = babel_handler${OBJ} register${OBJ} misc${OBJ} md5${OBJ} ${treaty_objs}\r
36 ifiction_objs = ifiction${OBJ} register_ifiction${OBJ}\r
37 babel_functions =  babel_story_functions${OBJ} babel_ifiction_functions${OBJ} babel_multi_functions${OBJ}\r
38 babel_objs = babel${OBJ} $(BABEL_FLIB) $(IFICTION_LIB) $(BABEL_LIB)\r
39 \r
40 babel: ${babel_objs} \r
41         ${CC} ${OUTPUT_BABEL} ${babel_objs}\r
42 \r
43 %${OBJ} : %.c\r
44         ${CC} -c $^\r
45 \r
46 register${OBJ}: modules.h\r
47 \r
48 babel.lib: ${foreach dep,${bh_objs},${dep}.bl}\r
49 \r
50 ifiction.lib: ${foreach dep,${ifiction_objs},${dep}.il}\r
51 \r
52 babel_functions.lib: ${foreach dep,${babel_functions},${dep}.fl}\r
53 \r
54 %.obj.bl: %.obj\r
55         tlib babel.lib +-$^\r
56         echo made > $@\r
57 \r
58 %.obj.il: %.obj\r
59         tlib ifiction.lib +-$^\r
60         echo made > $@\r
61 %.obj.fl: %.obj\r
62         tlib babel_functions.lib +-$^\r
63         echo made > $@\r
64 \r
65 babel.a: $(bh_objs)\r
66         ar -r babel.a $^\r
67 \r
68 ifiction.a: $(ifiction_objs)\r
69         ar -r ifiction.a $^\r
70 \r
71 babel_functions.a: $(babel_functions)\r
72         ar -r babel_functions.a $^\r
73 \r
74 dist: \r
75         cut -c0-31 MANIFEST | zip babel.zip -@\r