Mercurial > heirloom-ed
annotate makefile @ 4:4165f1b57d18 default tip
Become SUSv3 compatible and thus remove own regexp code
The Heirloom tools can be compiled to comply to several standards.
This version does not need this flexibility. We can omit the
regexp code and use the system's, by using the SU3 variant of ed.
This is the latest of the supported standards.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Mon, 13 Apr 2015 17:26:51 +0200 |
parents | 1493bea5ac22 |
children |
rev | line source |
---|---|
0
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
1 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
2 # Root directory. Mainly useful for package building; leave empty for |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
3 # normal installation. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
4 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
5 ROOT = |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
6 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
7 PREFIX = /usr/local |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
8 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
9 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
10 # Location for binaries. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
11 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
12 BINDIR = $(PREFIX)/bin |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
13 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
14 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
15 # Location for manual pages (with man1, man1b ... man8 below). |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
16 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
17 MANDIR = $(PREFIX)/share/man |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
18 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
19 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
20 # Compiler and linker flags. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
21 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
22 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
23 #CC = $(HOME)/src/diet gcc |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
24 CC = cc |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
25 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
26 LD = $(CC) |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
27 #LDFLAGS = --static |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
28 LDFLAGS = |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
29 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
30 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
31 # Flags for the C preprocessor. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
32 # On Linux with glibc or uClibc, add -D_GNU_SOURCE. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
33 # On Solaris, -D__EXTENSIONS__ should be added. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
34 # On HP-UX, -D_INCLUDE__STDC_A1_SOURCE must be added. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
35 # On AIX, -D_TPARM_COMPAT must be added. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
36 # On AIX, -D_MTEXTEND_H should be added if mtextend.h is not found. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
37 # On NetBSD, add -DUSE_TERMCAP. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
38 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
39 CPPFLAGS = -D_GNU_SOURCE |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
40 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
41 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
42 # CFLAGS makes it possible to give special |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
43 # compiler flags for objects where speed is critical. There is no other |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
44 # purpose with this so setting all to -O will work too. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
45 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
46 WARN = |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
47 CFLAGS = -O -fomit-frame-pointer $(WARN) |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
48 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
49 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
50 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
51 # Whether to use the supplied widechar emulation library. This should |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
52 # only be enabled if the system lacks appropriate widechar support. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
53 # It is currently needed on |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
54 # - Linux/diet libc |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
55 # - FreeBSD 4 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
56 # - NetBSD 1.x, because it lacks wctype_t/wctrans_t etc. in wctype.h. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
57 # - OpenBSD |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
58 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
59 #IWCHAR = -I../libwchar |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
60 #LWCHAR = -L../libwchar -lwchar |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
61 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
62 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
63 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
64 # Binaries are stripped with this command after installation. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
65 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
66 STRIP = strip -s -R .comment -R .note |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
67 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
68 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
69 # This is the shell used for the compilation phase, the execution of most |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
70 # installed scripts, and the shell escapes in the traditional command |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
71 # versions. It needs not conform to POSIX. The system shell should work |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
72 # fine; for maximum compatibility with traditional tools, the Heirloom |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
73 # Bourne shell is recommended. It then must obviously be compiled and |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
74 # installed first. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
75 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
76 SHELL = /bin/sh |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
77 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
78 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
79 # Don't change the rest of this file unless you really know what you are |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
80 # doing. |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
81 # |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
82 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
83 ######################################################################## |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
84 ######################################################################## |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
85 ######################################################################## |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
86 ######################################################################## |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
87 ######################################################################## |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
88 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
89 all: ed |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
90 |
4
4165f1b57d18
Become SUSv3 compatible and thus remove own regexp code
markus schnalke <meillo@marmaro.de>
parents:
0
diff
changeset
|
91 ed: ed.o sigset.o sigrelse.o |
0
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
92 $(LD) $(LDFLAGS) ed.o -o ed |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
93 |
4
4165f1b57d18
Become SUSv3 compatible and thus remove own regexp code
markus schnalke <meillo@marmaro.de>
parents:
0
diff
changeset
|
94 ed.o: ed.c |
0
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
95 $(CC) $(CFLAGS) $(CPPFLAGS) $(IWCHAR) -DSHELL='"$(SHELL)"' -I. -c ed.c |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
96 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
97 sigset.o: sigset.c sigset.h |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
98 $(CC) $(CFLAGS) $(CPPFLAGS) -I. -c sigset.c |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
99 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
100 sigrelse.o: sigrelse.c sigset.h |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
101 $(CC) $(CFLAGS) $(CPPFLAGS) -I. -c sigrelse.c |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
102 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
103 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
104 install: all |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
105 mkdir -p $(ROOT)$(BINDIR) |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
106 cp ed $(ROOT)$(BINDIR)/ed |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
107 chmod 755 $(ROOT)$(BINDIR)/ed |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
108 $(STRIP) $(ROOT)$(BINDIR)/ed |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
109 mkdir -p $(ROOT)$(MANDIR)/man1 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
110 cp ed.1 $(ROOT)$(MANDIR)/man1/ed.1 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
111 chmod 644 $(ROOT)$(MANDIR)/man1/ed.1 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
112 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
113 clean: |
4
4165f1b57d18
Become SUSv3 compatible and thus remove own regexp code
markus schnalke <meillo@marmaro.de>
parents:
0
diff
changeset
|
114 rm -f ed.o sigset.o sigrelse.o core log *~ |
0
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
115 |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
116 mrproper: clean |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
117 rm -f ed |
1493bea5ac22
Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff
changeset
|
118 |