| 1 | LEX = flex |
| 2 | BUILD = jethro kraut cockney jive nyc ken ky00te newspeak nethackify scramble |
| 3 | OTHER = eleet b1ff chef jibberish upside-down rasterman studly fudd \ |
| 4 | censor spammer uniencode pirate kenny scottish fanboy LOLCAT |
| 5 | CFLAGS = -O2 |
| 6 | export CFLAGS |
| 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 |
| 18 | |
| 19 | all: $(OTHER) $(BUILD) samples |
| 20 | |
| 21 | install: $(BUILD) $(OTHER) |
| 22 | install -d $(DESTDIR)/usr/games |
| 23 | $(INSTALL_PROGRAM) $(BUILD) $(DESTDIR)/usr/games/ |
| 24 | install $(OTHER) $(DESTDIR)/usr/games/ |
| 25 | install -d $(DESTDIR)/usr/share/man/man6 |
| 26 | install -m 0644 filters.6 $(DESTDIR)/usr/share/man/man6 |
| 27 | cd $(DESTDIR)/usr/share/man/man6 && \ |
| 28 | $(foreach prog,$(BUILD) $(OTHER),ln -s filters.6 $(prog).6;) |
| 29 | |
| 30 | samples: $(BUILD) $(OTHER) |
| 31 | -rm -f SAMPLES |
| 32 | PATH=.:$$PATH; export PATH; echo $(BUILD) $(OTHER) | xargs -n 1 sh makesample.sh |
| 33 | |
| 34 | clean: |
| 35 | $(RM) -f core *.o *~ $(BUILD) SAMPLES |
| 36 | cd ky00te.dir && make clean |
| 37 | |
| 38 | .SUFFIXES: .l |
| 39 | |
| 40 | .l: |
| 41 | $(RM) $*.c |
| 42 | $(LEX) -t $< > $*.c |
| 43 | $(CC) -o $@ $*.c $(CFLAGS) -lfl |
| 44 | $(RM) $*.c |
| 45 | |
| 46 | .SUFFIXES: .dir |
| 47 | |
| 48 | .dir: |
| 49 | cd $<; make |
| 50 | |
| 51 | ky00te: |
| 52 | cd ky00te.dir && make |
| 53 | |
| 54 | nethackify: nethackify.c |
| 55 | scramble: scramble.c |