source: auto/output/Makefile @ 8e1730c

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

Migration to new build system.

  • kon moved and checked
  • Property mode set to 100755
File size: 2.9 KB
RevLine 
[c08f3b1]1#!/bin/sh
2
3cat << EOF > Makefile
4# Default target
[12743b9]5.DEFAULT_GOAL = all
[c08f3b1]6
7SHELL = $SHELL
8CC = $CC
9BISON = $BISON
[44f59b8]10FLEX = $FLEX
[c08f3b1]11RM = $RM
12RMDIR = $RMDIR
13TEST = $TEST
14MAKE = $MAKE
15GREP = $GREP
16CUT = $CUT
17SORT = $SORT
18PR = $PR
[e4cec26]19CP = $CP
20CHMOD = $CHMOD
[c08f3b1]21
22CFLAGS = $CFLAGS
23LDFLAGS = $LDFLAGS
24LDLIBS = $LDLIBS
25BFLAGS = $BFLAGS
[e4cec26]26FFLAGS = $FFLAGS
[c08f3b1]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)
[44f59b8]44ALL_FFLAGS = -t \$(FFLAGS)
[c08f3b1]45
46VPATH = ./src
47
[8e1730c]48PROGRAMS = tok sen fla gph kot unfla grp mar ser kon
[12743b9]49
[44f59b8]50TOK_OBJ_FILES = tok.o tok_cmdline.o
51TOK_FLEX_FILES = tok.l
[12743b9]52TOK_GGO_FILES = tok_cmdline.ggo
[3a2ae91]53tok: \$(TOK_OBJ_FILES)
54tok.o: tok.c
[12743b9]55tok.o: tok_cmdline.h
[3a2ae91]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
[12743b9]60
[1e551bd]61SEN_OBJ_FILES = sen.o
62SEN_FLEX_FILES = sen.l
[3a2ae91]63sen: \$(SEN_OBJ_FILES)
64sen.o: sen.c
65sen.c: sen.l
[1e551bd]66
[9e0afb5]67FLA_OBJ_FILES = fla.o
[3a2ae91]68fla: \$(FLA_OBJ_FILES)
69fla.o: fla.c
[9e0afb5]70
[e4cec26]71GPH_PERL_FILES = gph.pl
[3a2ae91]72gph: \$(GPH_PERL_FILES)
73
74KOT_PERL_FILES = kot.pl
75kot: \$(KOT_PERL_FILES)
[e4cec26]76
[1e572e1]77UNFLA_SH_FILES = unfla.sh
78unfla: \$(UNFLA_SH_FILES)
79
[ac9a049]80GRP_PERL_FILES = grp.pl
81grp: \$(GRP_PERL_FILES)
82
[dc21769]83MAR_PERL_FILES = mar.pl
84mar: \$(MAR_PERL_FILES)
85
[8c8a252]86SER_PERL_FILES = ser.pl
87ser: \$(SER_PERL_FILES)
88
[8e1730c]89KON_PERL_FILES = kon.pl
90kon: \$(KON_PERL_FILES)
91
[c08f3b1]92CONFIG_FILES = src/config.h Makefile
93
94.SUFFIXES:
[3a2ae91]95.SUFFIXES: .l .y .h .c .pl .o
[c08f3b1]96
[3a2ae91]97#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
98#.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
99#.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
100#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
[1e551bd]101
[c08f3b1]102.PHONY: all
103all: \$(PROGRAMS)
[12743b9]104
[c08f3b1]105
106.PHONY: help
107help:
108        @\$(MAKE) --print-data-base --question |                \\
109        \$(GREP) '^[^.%][-A-Za-z0-9_]*:' |                      \\
110        \$(CUT) -f 1 -d : |                                     \\
111        \$(GREP) -v '^Makefile$$' |                             \\
112        \$(SORT) |                                              \\
113        \$(PR) --omit-pagination --width=80 --columns=4
114
115
116.PHONY: clean
117clean:
118        \$(RM) \$(PROGRAMS)
119        \$(RM) \$(TOK_OBJ_FILES)
[44f59b8]120        \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
[12743b9]121        \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
122        \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
[3a2ae91]123        \$(RM) \$(SEN_OBJ_FILES)
[1e551bd]124        \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
[3a2ae91]125        \$(RM) \$(FLA_OBJ_FILES)
[c08f3b1]126
127.PHONY: distclean
128distclean: clean
129        \$(RM) \$(CONFIG_FILES)
130
131.PHONY: install
132install: all
133        echo TODO: make install
134       
135.PHONY: uninstall
136uninstall:
137        echo TODO: make uninstall
138
139%.o: %.c
140        \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
141
[12743b9]142%.c: %.l
[44f59b8]143        \$(FLEX) -t \$< > \$@
144
[12743b9]145%.c: %.ggo
[e4cec26]146        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
[12743b9]147
148%.h: %.ggo
[e4cec26]149        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
[12743b9]150
[c08f3b1]151%: %.o
152        \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)
153
[e4cec26]154%: %.pl
155        \$(CP) \$< \$@
156        \$(CHMOD) a+x \$@
157
[1e572e1]158%: %.sh
159        \$(CP) \$< \$@
160        \$(CHMOD) a+x \$@
161
[c08f3b1]162EOF
163
Note: See TracBrowser for help on using the repository browser.