view 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
line wrap: on
line source

#
# Root directory. Mainly useful for package building; leave empty for
# normal installation.
#
ROOT = 

PREFIX = /usr/local

#
# Location for binaries.
#
BINDIR = $(PREFIX)/bin

#
# Location for manual pages (with man1, man1b ... man8 below).
#
MANDIR = $(PREFIX)/share/man

#
# Compiler and linker flags.
#

#CC = $(HOME)/src/diet gcc
CC = cc

LD = $(CC)
#LDFLAGS = --static
LDFLAGS = 

#
# Flags for the C preprocessor.
# On Linux with glibc or uClibc, add -D_GNU_SOURCE.
# On Solaris, -D__EXTENSIONS__ should be added.
# On HP-UX, -D_INCLUDE__STDC_A1_SOURCE must be added.
# On AIX, -D_TPARM_COMPAT must be added.
# On AIX, -D_MTEXTEND_H should be added if mtextend.h is not found.
# On NetBSD, add -DUSE_TERMCAP.
#
CPPFLAGS = -D_GNU_SOURCE

#
# CFLAGS makes it possible to give special
# compiler flags for objects where speed is critical. There is no other
# purpose with this so setting all to -O will work too.
#
WARN = 
CFLAGS = -O -fomit-frame-pointer $(WARN)


#
# Whether to use the supplied widechar emulation library. This should
# only be enabled if the system lacks appropriate widechar support.
# It is currently needed on
# - Linux/diet libc
# - FreeBSD 4
# - NetBSD 1.x, because it lacks wctype_t/wctrans_t etc. in wctype.h.
# - OpenBSD
#
#IWCHAR = -I../libwchar
#LWCHAR = -L../libwchar -lwchar


#
# Binaries are stripped with this command after installation.
#
STRIP = strip -s -R .comment -R .note

#
# This is the shell used for the compilation phase, the execution of most
# installed scripts, and the shell escapes in the traditional command
# versions. It needs not conform to POSIX. The system shell should work
# fine; for maximum compatibility with traditional tools, the Heirloom
# Bourne shell is recommended. It then must obviously be compiled and
# installed first.
#
SHELL = /bin/sh

#
# Don't change the rest of this file unless you really know what you are
# doing.
#

########################################################################
########################################################################
########################################################################
########################################################################
########################################################################

all: ed

ed: ed.o sigset.o sigrelse.o
	$(LD) $(LDFLAGS) ed.o -o ed

ed.o: ed.c
	$(CC) $(CFLAGS) $(CPPFLAGS) $(IWCHAR) -DSHELL='"$(SHELL)"' -I. -c ed.c

sigset.o: sigset.c sigset.h
	$(CC) $(CFLAGS) $(CPPFLAGS) -I. -c sigset.c

sigrelse.o: sigrelse.c sigset.h
	$(CC) $(CFLAGS) $(CPPFLAGS) -I. -c sigrelse.c


install: all
	mkdir -p $(ROOT)$(BINDIR)
	cp ed $(ROOT)$(BINDIR)/ed
	chmod 755 $(ROOT)$(BINDIR)/ed
	$(STRIP) $(ROOT)$(BINDIR)/ed
	mkdir -p $(ROOT)$(MANDIR)/man1
	cp ed.1 $(ROOT)$(MANDIR)/man1/ed.1
	chmod 644 $(ROOT)$(MANDIR)/man1/ed.1

clean:
	rm -f ed.o sigset.o sigrelse.o core log *~

mrproper: clean
	rm -f ed