source: auto/output/Makefile @ 1e551bd

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

Migration to new build system.

  • sen moved and checked
  • Property mode set to 100755
File size: 2.1 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
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
55CONFIG_FILES = src/config.h Makefile
56
57.SUFFIXES:
58.SUFFIXES: .l .y .h .c .o
59
60.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
61.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
62.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
63
64.INTERMEDIATE: \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
65
66.PHONY: all
67all: \$(PROGRAMS)
68
69
70.PHONY: help
71help:
72        @\$(MAKE) --print-data-base --question |                \\
73        \$(GREP) '^[^.%][-A-Za-z0-9_]*:' |                      \\
74        \$(CUT) -f 1 -d : |                                     \\
75        \$(GREP) -v '^Makefile$$' |                             \\
76        \$(SORT) |                                              \\
77        \$(PR) --omit-pagination --width=80 --columns=4
78
79
80.PHONY: clean
81clean:
82        \$(RM) \$(PROGRAMS)
83        \$(RM) \$(TOK_OBJ_FILES)
84        \$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
85        \$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
86        \$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
87        \$(RM) \$(patsubst %.l,%.c,\$(SEN_FLEX_FILES))
88
89.PHONY: distclean
90distclean: clean
91        \$(RM) \$(CONFIG_FILES)
92
93.PHONY: install
94install: all
95        echo TODO: make install
96       
97.PHONY: uninstall
98uninstall:
99        echo TODO: make uninstall
100
101%.o: %.c
102        \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
103
104%.c: %.l
105        \$(FLEX) -t \$< > \$@
106
107%.c: %.ggo
108        gengetopt --input $< --file-name \$(basename \$@) --conf-parser
109
110%.h: %.ggo
111        gengetopt --input $< --file-name \$(basename \$@) --conf-parser
112
113%: %.o
114        \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)
115
116tok: \$(TOK_OBJ_FILES)
117
118EOF
119
Note: See TracBrowser for help on using the repository browser.