Last change
on this file since c08f3b1 was
c08f3b1,
checked in by Mateusz Hromada <ruanda@…>, 16 years ago
|
New build system.
|
-
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 | echo all |
---|
54 | #make -C app compile |
---|
55 | |
---|
56 | .PHONY: help |
---|
57 | help: |
---|
58 | @\$(MAKE) --print-data-base --question | \\ |
---|
59 | \$(GREP) '^[^.%][-A-Za-z0-9_]*:' | \\ |
---|
60 | \$(CUT) -f 1 -d : | \\ |
---|
61 | \$(GREP) -v '^Makefile$$' | \\ |
---|
62 | \$(SORT) | \\ |
---|
63 | \$(PR) --omit-pagination --width=80 --columns=4 |
---|
64 | |
---|
65 | |
---|
66 | .PHONY: clean |
---|
67 | clean: |
---|
68 | \$(RM) \$(PROGRAMS) |
---|
69 | \$(RM) \$(TOK_OBJ_FILES) |
---|
70 | #make -C app clean |
---|
71 | |
---|
72 | .PHONY: distclean |
---|
73 | distclean: clean |
---|
74 | \$(RM) \$(CONFIG_FILES) |
---|
75 | |
---|
76 | .PHONY: install |
---|
77 | install: all |
---|
78 | echo TODO: make install |
---|
79 | |
---|
80 | .PHONY: uninstall |
---|
81 | uninstall: |
---|
82 | echo TODO: make uninstall |
---|
83 | |
---|
84 | %.o: %.c |
---|
85 | \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS) |
---|
86 | |
---|
87 | %: %.o |
---|
88 | \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS) |
---|
89 | |
---|
90 | tok: \$(TOK_OBJ_FILES) |
---|
91 | |
---|
92 | EOF |
---|
93 | |
---|
Note: See
TracBrowser
for help on using the repository browser.