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
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
[e4cec26]48PROGRAMS = tok sen fla gph
[12743b9]49
[44f59b8]50TOK_OBJ_FILES = tok.o tok_cmdline.o
51TOK_FLEX_FILES = tok.l
[12743b9]52TOK_GGO_FILES = tok_cmdline.ggo
53tok.o: tok_cmdline.h
54
[1e551bd]55SEN_OBJ_FILES = sen.o
56SEN_FLEX_FILES = sen.l
57
[9e0afb5]58FLA_OBJ_FILES = fla.o
59
[e4cec26]60GPH_PERL_FILES = gph.pl
61
[c08f3b1]62CONFIG_FILES = src/config.h Makefile
63
64.SUFFIXES:
65.SUFFIXES: .l .y .h .c .o
66
[12743b9]67.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
68.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
69.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
[1e551bd]70.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
71
[c08f3b1]72.PHONY: all
73all: \$(PROGRAMS)
[12743b9]74
[c08f3b1]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)
[44f59b8]90        \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
[12743b9]91        \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
92        \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
[1e551bd]93        \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
[c08f3b1]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
[12743b9]110%.c: %.l
[44f59b8]111        \$(FLEX) -t \$< > \$@
112
[12743b9]113%.c: %.ggo
[e4cec26]114        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
[12743b9]115
116%.h: %.ggo
[e4cec26]117        gengetopt --input \$< --file-name \$(basename \$@) --conf-parser
[12743b9]118
[c08f3b1]119%: %.o
120        \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)
121
[e4cec26]122%: %.pl
123        \$(CP) \$< \$@
124        \$(CHMOD) a+x \$@
125
[c08f3b1]126tok: \$(TOK_OBJ_FILES)
127
128EOF
129
Note: See TracBrowser for help on using the repository browser.