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