36c4fbeb |
1 | LEX = flex |
5b25ff5f |
2 | BUILD = jethro kraut cockney jive nyc ken ky00te newspeak nethackify |
b319174e |
3 | OTHER = eleet b1ff chef jibberish upside-down rasterman studly fudd censor spammer uniencode |
fb5da53f |
4 | CFLAGS = -O2 -lfl |
36c4fbeb |
5 | INSTALL_PROGRAM = install |
6 | |
7 | # DEB_BUILD_OPTIONS suport, to control binary stripping. |
8 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
9 | INSTALL_PROGRAM += -s |
10 | endif |
11 | |
12 | # And debug building. |
13 | ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) |
14 | CFLAGS += -g |
15 | endif |
7e3afbba |
16 | |
9edc0e61 |
17 | all: $(OTHER) $(BUILD) |
7e3afbba |
18 | |
9edc0e61 |
19 | install: $(BUILD) $(OTHER) |
7e3afbba |
20 | install -d $(PREFIX)/usr/games |
36c4fbeb |
21 | $(INSTALL_PROGRAM) $(BUILD) $(PREFIX)/usr/games/ |
22 | install $(OTHER) $(PREFIX)/usr/games/ |
f49da801 |
23 | install -d $(PREFIX)/usr/share/man/man6 |
24 | install -m 0644 filters.6 $(PREFIX)/usr/share/man/man6 |
25 | cd $(PREFIX)/usr/share/man/man6 && \ |
9edc0e61 |
26 | $(foreach prog,$(BUILD) $(OTHER),ln -s filters.6 $(prog).6;) |
7e3afbba |
27 | |
9edc0e61 |
28 | samples: $(BUILD) $(OTHER) |
f49da801 |
29 | -rm -f SAMPLES |
9edc0e61 |
30 | PATH=.:$$PATH; export PATH; echo $(BUILD) $(OTHER) |xargs -n 1 sh makesample.sh |
7e3afbba |
31 | |
32 | clean: |
9edc0e61 |
33 | $(RM) -f core *.o *~ $(BUILD) *.c SAMPLES |
bc19f2cf |
34 | cd ky00te.dir && make clean |
1afef5f2 |
35 | rm -f kraut.dir/lex.yy.c |
5b25ff5f |
36 | cd nethackify.dir && make clean |
7e3afbba |
37 | |
38 | .SUFFIXES: .l |
39 | |
40 | .l: |
41 | $(RM) $*.c |
42 | $(LEX) -t $< > $*.c |
fb5da53f |
43 | $(CC) -o $@ $*.c $(CFLAGS) |
7e3afbba |
44 | $(RM) $*.c |
45 | |
46 | .SUFFIXES: .dir |
47 | |
48 | .dir: |
49 | cd $<; make |
f49da801 |
50 | |
bc19f2cf |
51 | ky00te: |
52 | cd ky00te.dir && make |
53 | |
f49da801 |
54 | kraut: |
55 | cd kraut.dir && lex kraut.l |
56 | cd kraut.dir && cc kraut.c lex.yy.c -o ../kraut |
5b25ff5f |
57 | |
58 | nethackify: |
59 | cd nethackify.dir && make |