heirloom-ed

annotate makefile @ 4:4165f1b57d18

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