Last change
on this file since 44f59b8 was
44f59b8,
checked in by Mateusz Hromada <ruanda@…>, 16 years ago
|
Add flex support in configure scripts.
|
-
Property mode set to
100755
|
File size:
1.6 KB
|
Rev | Line | |
---|
[c08f3b1] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | cat << EOF > Makefile |
---|
| 4 | # Default target |
---|
| 5 | .DEFAULT: all |
---|
| 6 | |
---|
| 7 | SHELL = $SHELL |
---|
| 8 | CC = $CC |
---|
| 9 | BISON = $BISON |
---|
[44f59b8] | 10 | FLEX = $FLEX |
---|
[c08f3b1] | 11 | RM = $RM |
---|
| 12 | RMDIR = $RMDIR |
---|
| 13 | TEST = $TEST |
---|
| 14 | MAKE = $MAKE |
---|
| 15 | GREP = $GREP |
---|
| 16 | CUT = $CUT |
---|
| 17 | SORT = $SORT |
---|
| 18 | PR = $PR |
---|
| 19 | |
---|
| 20 | CFLAGS = $CFLAGS |
---|
| 21 | LDFLAGS = $LDFLAGS |
---|
| 22 | LDLIBS = $LDLIBS |
---|
| 23 | BFLAGS = $BFLAGS |
---|
| 24 | |
---|
| 25 | DESTDIR = $DESTDIR |
---|
| 26 | |
---|
| 27 | prefix = $prefix |
---|
| 28 | exec_prefix = $exec_prefix |
---|
| 29 | bindir = $bindir |
---|
| 30 | sbindir = $sbindir |
---|
| 31 | datarootdir = $datarootdir |
---|
| 32 | datadir = $datadir |
---|
| 33 | sysconfdir = $sysconfdir |
---|
| 34 | sharedstatedir = $sharestatedir |
---|
| 35 | localstatedir = $localstatedir |
---|
| 36 | |
---|
| 37 | ALL_CFLAGS = \$(CFLAGS) |
---|
| 38 | ALL_LDFLAGS = \$(LDFLAGS) |
---|
| 39 | ALL_LDLIBS = \$(LDLIBS) |
---|
| 40 | ALL_BFLAGS = \$(BFLAGS) |
---|
[44f59b8] | 41 | ALL_FFLAGS = -t \$(FFLAGS) |
---|
[c08f3b1] | 42 | |
---|
| 43 | VPATH = ./src |
---|
| 44 | |
---|
| 45 | PROGRAMS = tok |
---|
[44f59b8] | 46 | TOK_OBJ_FILES = tok.o tok_cmdline.o |
---|
| 47 | TOK_FLEX_FILES = tok.l |
---|
[c08f3b1] | 48 | CONFIG_FILES = src/config.h Makefile |
---|
| 49 | |
---|
| 50 | .SUFFIXES: |
---|
| 51 | .SUFFIXES: .l .y .h .c .o |
---|
| 52 | |
---|
| 53 | .PHONY: all |
---|
| 54 | all: \$(PROGRAMS) |
---|
| 55 | #make -C app compile |
---|
| 56 | |
---|
| 57 | .PHONY: help |
---|
| 58 | help: |
---|
| 59 | @\$(MAKE) --print-data-base --question | \\ |
---|
| 60 | \$(GREP) '^[^.%][-A-Za-z0-9_]*:' | \\ |
---|
| 61 | \$(CUT) -f 1 -d : | \\ |
---|
| 62 | \$(GREP) -v '^Makefile$$' | \\ |
---|
| 63 | \$(SORT) | \\ |
---|
| 64 | \$(PR) --omit-pagination --width=80 --columns=4 |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | .PHONY: clean |
---|
| 68 | clean: |
---|
| 69 | \$(RM) \$(PROGRAMS) |
---|
| 70 | \$(RM) \$(TOK_OBJ_FILES) |
---|
[44f59b8] | 71 | \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES)) |
---|
[c08f3b1] | 72 | #make -C app clean |
---|
| 73 | |
---|
| 74 | .PHONY: distclean |
---|
| 75 | distclean: clean |
---|
| 76 | \$(RM) \$(CONFIG_FILES) |
---|
| 77 | |
---|
| 78 | .PHONY: install |
---|
| 79 | install: all |
---|
| 80 | echo TODO: make install |
---|
| 81 | |
---|
| 82 | .PHONY: uninstall |
---|
| 83 | uninstall: |
---|
| 84 | echo TODO: make uninstall |
---|
| 85 | |
---|
| 86 | %.o: %.c |
---|
| 87 | \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS) |
---|
| 88 | |
---|
[44f59b8] | 89 | %.o: %.l |
---|
| 90 | \$(FLEX) -t \$< > \$@ |
---|
| 91 | |
---|
[c08f3b1] | 92 | %: %.o |
---|
| 93 | \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS) |
---|
| 94 | |
---|
| 95 | tok: \$(TOK_OBJ_FILES) |
---|
| 96 | |
---|
| 97 | EOF |
---|
| 98 | |
---|
Note: See
TracBrowser
for help on using the repository browser.