source: auto/output/Makefile @ 3a2ae91

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

Migration to new build system.

  • kot moved and checked
  • Property mode set to 100755
File size: 2.6 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
[3a2ae91]48PROGRAMS = tok sen fla gph kot
[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
[c08f3b1]77CONFIG_FILES = src/config.h Makefile
78
79.SUFFIXES:
[3a2ae91]80.SUFFIXES: .l .y .h .c .pl .o
[c08f3b1]81
[3a2ae91]82#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
83#.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
84#.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
85#.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
[1e551bd]86
[c08f3b1]87.PHONY: all
88all: \$(PROGRAMS)
[12743b9]89
[c08f3b1]90
91.PHONY: help
92help:
93        @\$(MAKE) --print-data-base --question |                \\
94        \$(GREP) '^[^.%][-A-Za-z0-9_]*:' |                      \\
95        \$(CUT) -f 1 -d : |                                     \\
96        \$(GREP) -v '^Makefile$$' |                             \\
97        \$(SORT) |                                              \\
98        \$(PR) --omit-pagination --width=80 --columns=4
99
100
101.PHONY: clean
102clean:
103        \$(RM) \$(PROGRAMS)
104        \$(RM) \$(TOK_OBJ_FILES)
[44f59b8]105        \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
[12743b9]106        \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
107        \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
[3a2ae91]108        \$(RM) \$(SEN_OBJ_FILES)
[1e551bd]109        \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
[3a2ae91]110        \$(RM) \$(FLA_OBJ_FILES)
[c08f3b1]111
112.PHONY: distclean
113distclean: clean
114        \$(RM) \$(CONFIG_FILES)
115
116.PHONY: install
117install: all
118        echo TODO: make install
119       
120.PHONY: uninstall
121uninstall:
122        echo TODO: make uninstall
123
124%.o: %.c
125        \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
126
[12743b9]127%.c: %.l
[44f59b8]128        \$(FLEX) -t \$< > \$@
129
[12743b9]130%.c: %.ggo
[e4cec26]131        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
[12743b9]132
133%.h: %.ggo
[e4cec26]134        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
[12743b9]135
[c08f3b1]136%: %.o
137        \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)
138
[e4cec26]139%: %.pl
140        \$(CP) \$< \$@
141        \$(CHMOD) a+x \$@
142
[c08f3b1]143EOF
144
Note: See TracBrowser for help on using the repository browser.