source: auto/output/Makefile @ dc21769

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

Migration to new build system.

  • mar moved and checked
  • Property mode set to 100755
File size: 2.8 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 kot unfla grp mar
49
50TOK_OBJ_FILES = tok.o tok_cmdline.o
51TOK_FLEX_FILES = tok.l
52TOK_GGO_FILES = tok_cmdline.ggo
53tok: \$(TOK_OBJ_FILES)
54tok.o: tok.c
55tok.o: tok_cmdline.h
56tok.c: tok.l
57tok_cmdline.o: tok_cmdline.c tok_cmdline.h
58tok_cmdline.c: tok_cmdline.ggo
59tok_cmdline.h: tok_cmdline.ggo
60
61SEN_OBJ_FILES = sen.o
62SEN_FLEX_FILES = sen.l
63sen: \$(SEN_OBJ_FILES)
64sen.o: sen.c
65sen.c: sen.l
66
67FLA_OBJ_FILES = fla.o
68fla: \$(FLA_OBJ_FILES)
69fla.o: fla.c
70
71GPH_PERL_FILES = gph.pl
72gph: \$(GPH_PERL_FILES)
73
74KOT_PERL_FILES = kot.pl
75kot: \$(KOT_PERL_FILES)
76
77UNFLA_SH_FILES = unfla.sh
78unfla: \$(UNFLA_SH_FILES)
79
80GRP_PERL_FILES = grp.pl
81grp: \$(GRP_PERL_FILES)
82
83MAR_PERL_FILES = mar.pl
84mar: \$(MAR_PERL_FILES)
85
86CONFIG_FILES = src/config.h Makefile
87
88.SUFFIXES:
89.SUFFIXES: .l .y .h .c .pl .o
90
91#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
92#.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
93#.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
94#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
95
96.PHONY: all
97all: \$(PROGRAMS)
98
99
100.PHONY: help
101help:
102        @\$(MAKE) --print-data-base --question |                \\
103        \$(GREP) '^[^.%][-A-Za-z0-9_]*:' |                      \\
104        \$(CUT) -f 1 -d : |                                     \\
105        \$(GREP) -v '^Makefile$$' |                             \\
106        \$(SORT) |                                              \\
107        \$(PR) --omit-pagination --width=80 --columns=4
108
109
110.PHONY: clean
111clean:
112        \$(RM) \$(PROGRAMS)
113        \$(RM) \$(TOK_OBJ_FILES)
114        \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
115        \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
116        \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
117        \$(RM) \$(SEN_OBJ_FILES)
118        \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
119        \$(RM) \$(FLA_OBJ_FILES)
120
121.PHONY: distclean
122distclean: clean
123        \$(RM) \$(CONFIG_FILES)
124
125.PHONY: install
126install: all
127        echo TODO: make install
128       
129.PHONY: uninstall
130uninstall:
131        echo TODO: make uninstall
132
133%.o: %.c
134        \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
135
136%.c: %.l
137        \$(FLEX) -t \$< > \$@
138
139%.c: %.ggo
140        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
141
142%.h: %.ggo
143        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
144
145%: %.o
146        \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)
147
148%: %.pl
149        \$(CP) \$< \$@
150        \$(CHMOD) a+x \$@
151
152%: %.sh
153        \$(CP) \$< \$@
154        \$(CHMOD) a+x \$@
155
156EOF
157
Note: See TracBrowser for help on using the repository browser.