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