meillo@0: # meillo@0: # Root directory. Mainly useful for package building; leave empty for meillo@0: # normal installation. meillo@0: # meillo@0: ROOT = meillo@0: meillo@0: PREFIX = /usr/local meillo@0: meillo@0: # meillo@0: # Location for binaries. meillo@0: # meillo@0: BINDIR = $(PREFIX)/bin meillo@0: meillo@0: # meillo@0: # Location for manual pages (with man1, man1b ... man8 below). meillo@0: # meillo@0: MANDIR = $(PREFIX)/share/man meillo@0: meillo@0: # meillo@0: # Compiler and linker flags. meillo@0: # meillo@0: meillo@0: #CC = $(HOME)/src/diet gcc meillo@0: CC = cc meillo@0: meillo@0: LD = $(CC) meillo@0: #LDFLAGS = --static meillo@0: LDFLAGS = meillo@0: meillo@0: # meillo@0: # Flags for the C preprocessor. meillo@0: # On Linux with glibc or uClibc, add -D_GNU_SOURCE. meillo@0: # On Solaris, -D__EXTENSIONS__ should be added. meillo@0: # On HP-UX, -D_INCLUDE__STDC_A1_SOURCE must be added. meillo@0: # On AIX, -D_TPARM_COMPAT must be added. meillo@0: # On AIX, -D_MTEXTEND_H should be added if mtextend.h is not found. meillo@0: # On NetBSD, add -DUSE_TERMCAP. meillo@0: # meillo@0: CPPFLAGS = -D_GNU_SOURCE meillo@0: meillo@0: # meillo@0: # CFLAGS makes it possible to give special meillo@0: # compiler flags for objects where speed is critical. There is no other meillo@0: # purpose with this so setting all to -O will work too. meillo@0: # meillo@0: WARN = meillo@0: CFLAGS = -O -fomit-frame-pointer $(WARN) meillo@0: meillo@0: meillo@0: # meillo@0: # Whether to use the supplied widechar emulation library. This should meillo@0: # only be enabled if the system lacks appropriate widechar support. meillo@0: # It is currently needed on meillo@0: # - Linux/diet libc meillo@0: # - FreeBSD 4 meillo@0: # - NetBSD 1.x, because it lacks wctype_t/wctrans_t etc. in wctype.h. meillo@0: # - OpenBSD meillo@0: # meillo@0: #IWCHAR = -I../libwchar meillo@0: #LWCHAR = -L../libwchar -lwchar meillo@0: meillo@0: meillo@0: # meillo@0: # Binaries are stripped with this command after installation. meillo@0: # meillo@0: STRIP = strip -s -R .comment -R .note meillo@0: meillo@0: # meillo@0: # This is the shell used for the compilation phase, the execution of most meillo@0: # installed scripts, and the shell escapes in the traditional command meillo@0: # versions. It needs not conform to POSIX. The system shell should work meillo@0: # fine; for maximum compatibility with traditional tools, the Heirloom meillo@0: # Bourne shell is recommended. It then must obviously be compiled and meillo@0: # installed first. meillo@0: # meillo@0: SHELL = /bin/sh meillo@0: meillo@0: # meillo@0: # Don't change the rest of this file unless you really know what you are meillo@0: # doing. meillo@0: # meillo@0: meillo@0: ######################################################################## meillo@0: ######################################################################## meillo@0: ######################################################################## meillo@0: ######################################################################## meillo@0: ######################################################################## meillo@0: meillo@0: all: ed meillo@0: meillo@4: ed: ed.o sigset.o sigrelse.o meillo@0: $(LD) $(LDFLAGS) ed.o -o ed meillo@0: meillo@4: ed.o: ed.c meillo@0: $(CC) $(CFLAGS) $(CPPFLAGS) $(IWCHAR) -DSHELL='"$(SHELL)"' -I. -c ed.c meillo@0: meillo@0: sigset.o: sigset.c sigset.h meillo@0: $(CC) $(CFLAGS) $(CPPFLAGS) -I. -c sigset.c meillo@0: meillo@0: sigrelse.o: sigrelse.c sigset.h meillo@0: $(CC) $(CFLAGS) $(CPPFLAGS) -I. -c sigrelse.c meillo@0: meillo@0: meillo@0: install: all meillo@0: mkdir -p $(ROOT)$(BINDIR) meillo@0: cp ed $(ROOT)$(BINDIR)/ed meillo@0: chmod 755 $(ROOT)$(BINDIR)/ed meillo@0: $(STRIP) $(ROOT)$(BINDIR)/ed meillo@0: mkdir -p $(ROOT)$(MANDIR)/man1 meillo@0: cp ed.1 $(ROOT)$(MANDIR)/man1/ed.1 meillo@0: chmod 644 $(ROOT)$(MANDIR)/man1/ed.1 meillo@0: meillo@0: clean: meillo@4: rm -f ed.o sigset.o sigrelse.o core log *~ meillo@0: meillo@0: mrproper: clean meillo@0: rm -f ed meillo@0: