source: auto/output/Makefile @ 63a5739

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

Improvements on configure script.

  • config.h has more details about project
  • configure creates src directory unless it exists
  • Property mode set to 100755
File size: 1.4 KB
Line 
1#!/bin/sh
2
3cat << EOF > Makefile
4# Default target
5.DEFAULT: all
6
7SHELL = $SHELL
8CC = $CC
9BISON = $BISON
10RM = $RM
11RMDIR = $RMDIR
12TEST = $TEST
13MAKE = $MAKE
14GREP = $GREP
15CUT = $CUT
16SORT = $SORT
17PR = $PR
18
19CFLAGS = $CFLAGS
20LDFLAGS = $LDFLAGS
21LDLIBS = $LDLIBS
22BFLAGS = $BFLAGS
23
24DESTDIR = $DESTDIR
25
26prefix = $prefix
27exec_prefix = $exec_prefix
28bindir = $bindir
29sbindir = $sbindir
30datarootdir = $datarootdir
31datadir = $datadir
32sysconfdir = $sysconfdir
33sharedstatedir = $sharestatedir
34localstatedir = $localstatedir
35
36ALL_CFLAGS = \$(CFLAGS)
37ALL_LDFLAGS = \$(LDFLAGS)
38ALL_LDLIBS = \$(LDLIBS)
39ALL_BFLAGS = \$(BFLAGS)
40ALL_FFLAGS = \$(FFLAGS)
41
42VPATH = ./src
43
44PROGRAMS = tok
45TOK_OBJ_FILES = tok.o
46CONFIG_FILES = src/config.h Makefile
47
48.SUFFIXES:
49.SUFFIXES: .l .y .h .c .o
50
51.PHONY: all
52all: \$(PROGRAMS)
53        #make -C app compile
54
55.PHONY: help
56help:
57        @\$(MAKE) --print-data-base --question |                \\
58        \$(GREP) '^[^.%][-A-Za-z0-9_]*:' |                      \\
59        \$(CUT) -f 1 -d : |                                     \\
60        \$(GREP) -v '^Makefile$$' |                             \\
61        \$(SORT) |                                              \\
62        \$(PR) --omit-pagination --width=80 --columns=4
63
64
65.PHONY: clean
66clean:
67        \$(RM) \$(PROGRAMS)
68        \$(RM) \$(TOK_OBJ_FILES)
69        #make -C app clean
70
71.PHONY: distclean
72distclean: clean
73        \$(RM) \$(CONFIG_FILES)
74
75.PHONY: install
76install: all
77        echo TODO: make install
78       
79.PHONY: uninstall
80uninstall:
81        echo TODO: make uninstall
82
83%.o: %.c
84        \$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
85
86%: %.o
87        \$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)
88
89tok: \$(TOK_OBJ_FILES)
90
91EOF
92
Note: See TracBrowser for help on using the repository browser.