heirloom-ed

diff makefile @ 0:1493bea5ac22

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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/makefile	Mon Sep 05 16:31:35 2011 +0200
     1.3 @@ -0,0 +1,121 @@
     1.4 +#
     1.5 +# Root directory. Mainly useful for package building; leave empty for
     1.6 +# normal installation.
     1.7 +#
     1.8 +ROOT = 
     1.9 +
    1.10 +PREFIX = /usr/local
    1.11 +
    1.12 +#
    1.13 +# Location for binaries.
    1.14 +#
    1.15 +BINDIR = $(PREFIX)/bin
    1.16 +
    1.17 +#
    1.18 +# Location for manual pages (with man1, man1b ... man8 below).
    1.19 +#
    1.20 +MANDIR = $(PREFIX)/share/man
    1.21 +
    1.22 +#
    1.23 +# Compiler and linker flags.
    1.24 +#
    1.25 +
    1.26 +#CC = $(HOME)/src/diet gcc
    1.27 +CC = cc
    1.28 +
    1.29 +LD = $(CC)
    1.30 +#LDFLAGS = --static
    1.31 +LDFLAGS = 
    1.32 +
    1.33 +#
    1.34 +# Flags for the C preprocessor.
    1.35 +# On Linux with glibc or uClibc, add -D_GNU_SOURCE.
    1.36 +# On Solaris, -D__EXTENSIONS__ should be added.
    1.37 +# On HP-UX, -D_INCLUDE__STDC_A1_SOURCE must be added.
    1.38 +# On AIX, -D_TPARM_COMPAT must be added.
    1.39 +# On AIX, -D_MTEXTEND_H should be added if mtextend.h is not found.
    1.40 +# On NetBSD, add -DUSE_TERMCAP.
    1.41 +#
    1.42 +CPPFLAGS = -D_GNU_SOURCE
    1.43 +
    1.44 +#
    1.45 +# CFLAGS makes it possible to give special
    1.46 +# compiler flags for objects where speed is critical. There is no other
    1.47 +# purpose with this so setting all to -O will work too.
    1.48 +#
    1.49 +WARN = 
    1.50 +CFLAGS = -O -fomit-frame-pointer $(WARN)
    1.51 +
    1.52 +
    1.53 +#
    1.54 +# Whether to use the supplied widechar emulation library. This should
    1.55 +# only be enabled if the system lacks appropriate widechar support.
    1.56 +# It is currently needed on
    1.57 +# - Linux/diet libc
    1.58 +# - FreeBSD 4
    1.59 +# - NetBSD 1.x, because it lacks wctype_t/wctrans_t etc. in wctype.h.
    1.60 +# - OpenBSD
    1.61 +#
    1.62 +#IWCHAR = -I../libwchar
    1.63 +#LWCHAR = -L../libwchar -lwchar
    1.64 +
    1.65 +
    1.66 +#
    1.67 +# Binaries are stripped with this command after installation.
    1.68 +#
    1.69 +STRIP = strip -s -R .comment -R .note
    1.70 +
    1.71 +#
    1.72 +# This is the shell used for the compilation phase, the execution of most
    1.73 +# installed scripts, and the shell escapes in the traditional command
    1.74 +# versions. It needs not conform to POSIX. The system shell should work
    1.75 +# fine; for maximum compatibility with traditional tools, the Heirloom
    1.76 +# Bourne shell is recommended. It then must obviously be compiled and
    1.77 +# installed first.
    1.78 +#
    1.79 +SHELL = /bin/sh
    1.80 +
    1.81 +#
    1.82 +# Don't change the rest of this file unless you really know what you are
    1.83 +# doing.
    1.84 +#
    1.85 +
    1.86 +########################################################################
    1.87 +########################################################################
    1.88 +########################################################################
    1.89 +########################################################################
    1.90 +########################################################################
    1.91 +
    1.92 +all: ed
    1.93 +
    1.94 +ed: ed.o regexpr.o sigset.o sigrelse.o
    1.95 +	$(LD) $(LDFLAGS) ed.o -o ed
    1.96 +
    1.97 +ed.o: ed.c regexp.h
    1.98 +	$(CC) $(CFLAGS) $(CPPFLAGS) $(IWCHAR) -DSHELL='"$(SHELL)"' -I. -c ed.c
    1.99 +
   1.100 +regexpr.o: regexpr.c regexpr.h regexp.h
   1.101 +	$(CC) $(CFLAGS) $(CPPFLAGS) $(IWCHAR) -I. -c regexpr.c
   1.102 +
   1.103 +sigset.o: sigset.c sigset.h
   1.104 +	$(CC) $(CFLAGS) $(CPPFLAGS) -I. -c sigset.c
   1.105 +
   1.106 +sigrelse.o: sigrelse.c sigset.h
   1.107 +	$(CC) $(CFLAGS) $(CPPFLAGS) -I. -c sigrelse.c
   1.108 +
   1.109 +
   1.110 +install: all
   1.111 +	mkdir -p $(ROOT)$(BINDIR)
   1.112 +	cp ed $(ROOT)$(BINDIR)/ed
   1.113 +	chmod 755 $(ROOT)$(BINDIR)/ed
   1.114 +	$(STRIP) $(ROOT)$(BINDIR)/ed
   1.115 +	mkdir -p $(ROOT)$(MANDIR)/man1
   1.116 +	cp ed.1 $(ROOT)$(MANDIR)/man1/ed.1
   1.117 +	chmod 644 $(ROOT)$(MANDIR)/man1/ed.1
   1.118 +
   1.119 +clean:
   1.120 +	rm -f ed.o regexpr.o sigset.o sigrelse.o core log *~
   1.121 +
   1.122 +mrproper: clean
   1.123 +	rm -f ed
   1.124 +