source: auto/output/Makefile @ 12743b9

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

Migration to new build system. All tools need to be moved to ./src
directory and checked whether can be compiled by Makefile.

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