source: auto/output/Makefile @ e4cec26

Last change on this file since e4cec26 was e4cec26, checked in by Mateusz Hromada <ruanda@…>, 15 years ago

Migration to new build system.

  • gph moved and checked
  • Property mode set to 100755
File size: 2.3 KB
Line 
1#!/bin/sh
2
3cat << EOF > Makefile
4# Default target
5.DEFAULT_GOAL = all
6
7SHELL = $SHELL
8CC = $CC
9BISON = $BISON
10FLEX = $FLEX
11RM = $RM
12RMDIR = $RMDIR
13TEST = $TEST
14MAKE = $MAKE
15GREP = $GREP
16CUT = $CUT
17SORT = $SORT
18PR = $PR
19CP = $CP
20CHMOD = $CHMOD
21
22CFLAGS = $CFLAGS
23LDFLAGS = $LDFLAGS
24LDLIBS = $LDLIBS
25BFLAGS = $BFLAGS
26FFLAGS = $FFLAGS
27
28DESTDIR = $DESTDIR
29
30prefix = $prefix
31exec_prefix = $exec_prefix
32bindir = $bindir
33sbindir = $sbindir
34datarootdir = $datarootdir
35datadir = $datadir
36sysconfdir = $sysconfdir
37sharedstatedir = $sharestatedir
38localstatedir = $localstatedir
39
40ALL_CFLAGS = \$(CFLAGS)
41ALL_LDFLAGS = \$(LDFLAGS)
42ALL_LDLIBS = \$(LDLIBS)
43ALL_BFLAGS = \$(BFLAGS)
44ALL_FFLAGS = -t \$(FFLAGS)
45
46VPATH = ./src
47
48PROGRAMS = tok sen fla gph
49
50TOK_OBJ_FILES = tok.o tok_cmdline.o
51TOK_FLEX_FILES = tok.l
52TOK_GGO_FILES = tok_cmdline.ggo
53tok.o: tok_cmdline.h
54
55SEN_OBJ_FILES = sen.o
56SEN_FLEX_FILES = sen.l
57
58FLA_OBJ_FILES = fla.o
59
60GPH_PERL_FILES = gph.pl
61
62CONFIG_FILES = src/config.h Makefile
63
64.SUFFIXES:
65.SUFFIXES: .l .y .h .c .o
66
67.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
68.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
69.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
70.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
71
72.PHONY: all
73all: \$(PROGRAMS)
74
75
76.PHONY: help
77help:
78        @\$(MAKE) --print-data-base --question |                \\
79        \$(GREP) '^[^.%][-A-Za-z0-9_]*:' |                      \\
80        \$(CUT) -f 1 -d : |                                     \\
81        \$(GREP) -v '^Makefile$$' |                             \\
82        \$(SORT) |                                              \\
83        \$(PR) --omit-pagination --width=80 --columns=4
84
85
86.PHONY: clean
87clean:
88        \$(RM) \$(PROGRAMS)
89        \$(RM) \$(TOK_OBJ_FILES)
90        \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
91        \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
92        \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
93        \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
94
95.PHONY: distclean
96distclean: clean
97        \$(RM) \$(CONFIG_FILES)
98
99.PHONY: install
100install: all
101        echo TODO: make install
102       
103.PHONY: uninstall
104uninstall:
105        echo TODO: make uninstall
106
107%.o: %.c
108        \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
109
110%.c: %.l
111        \$(FLEX) -t \$< > \$@
112
113%.c: %.ggo
114        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
115
116%.h: %.ggo
117        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
118
119%: %.o
120        \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)
121
122%: %.pl
123        \$(CP) \$< \$@
124        \$(CHMOD) a+x \$@
125
126tok: \$(TOK_OBJ_FILES)
127
128EOF
129
Note: See TracBrowser for help on using the repository browser.