source: auto/output/Makefile @ 9e0afb5

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

Migration to new build system.

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