1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
# Standard Linux makefile for BSD csh.
CC = gcc
CCOMPAT =
CDEFS = -U_POSIX_SOURCE -DFILEC -DNLS -DSHORT_STRINGS -I.
CPPFLAGS= $(CCOMPAT) $(CDEFS)
CFLAGS = -g -O2
INSTALL_BIN = install -c -s -g root -m 0755 -o root
INSTALL_DIR = install -d -g root -m 0755 -o root
INSTALL_MAN = install -c -g root -m 0644 -o root
BINDIR = /usr/bin
MANDIR = /usr/man/man1
SOURCES = alloc.c char.c const.c csh.c dir.c dol.c err.c exec.o exp.c file.c \
func.c glob.c hist.c init.c lex.c misc.c parse.c print.c printf.c \
proc.c sem.c set.c str.c time.c _glob.c
all: err.h const.h csh
csh: $(SOURCES:.c=.o)
err.h:
@rm -f $@
@echo '/* Do not edit this file, make creates it. */' > $@
@echo '#ifndef _h_sh_err' >> $@
@echo '#define _h_sh_err' >> $@
egrep 'ERR_' ./$*.c | egrep '^#define' >> $@
@echo '#endif /* _h_sh_err */' >> $@
const.h:
@rm -f $@
@echo '/* Do not edit this file, make creates it. */' > $@
${CC} -E ${CPPFLAGS} ./$*.c | egrep 'Char STR' | \
sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
sort >> $@
install:
$(INSTALL_DIR) $(PREFIX)$(BINDIR)
$(INSTALL_DIR) $(PREFIX)$(MANDIR)
$(INSTALL_BIN) csh $(PREFIX)$(BINDIR)
$(INSTALL_MAN) csh.1 $(PREFIX)$(MANDIR)
clean:
rm -f *.o core
rm -f csh const.h err.h
|