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