Given regexp stuff its own Makefile in regexp.

Major Makefile overhaul, maily implementation of new directory structure
and consolidation of file macros
Use more GNU make features
This commit is contained in:
Thomas Jensen
1999-08-13 23:55:03 +00:00
parent 13154120e5
commit b0ba6c4baf

View File

@ -3,7 +3,7 @@
# Creation: March 18, 1999 (Thursday, 15:10h) # Creation: March 18, 1999 (Thursday, 15:10h)
# Author: Copyright (C) 1999 Thomas Jensen # Author: Copyright (C) 1999 Thomas Jensen
# tsjensen@stud.informatik.uni-erlangen.de # tsjensen@stud.informatik.uni-erlangen.de
# Version: $Id: Makefile,v 1.11 1999/07/12 18:28:53 tsjensen Exp tsjensen $ # Version: $Id: Makefile,v 1.12 1999/07/20 18:49:58 tsjensen Exp tsjensen $
# Format: GNU make # Format: GNU make
# Web Site: http://home.pages.de/~jensen/boxes/ # Web Site: http://home.pages.de/~jensen/boxes/
# Platforms: sparc/Solaris 2.6 and others # Platforms: sparc/Solaris 2.6 and others
@ -25,6 +25,11 @@
# Revision History: # Revision History:
# #
# $Log: Makefile,v $ # $Log: Makefile,v $
# Revision 1.12 1999/07/20 18:49:58 tsjensen
# Added GNU GPL disclaimer
# Now evaluating date command from SNAPFILE only once
# Changed order of files in snapshot archive (who cares)
#
# Revision 1.11 1999/07/12 18:28:53 tsjensen # Revision 1.11 1999/07/12 18:28:53 tsjensen
# Removed --yacc option from bison call # Removed --yacc option from bison call
# Added logpage target to generate the chronologically sorted global change # Added logpage target to generate the chronologically sorted global change
@ -87,23 +92,27 @@
#============================================================================ #============================================================================
LEX = flex LEX = flex
YACC = bison YACC = bison
CC = gcc CC = gcc
CFLAGS = -ansi -I. -Iregexp $(CFLAGS_ADDTL) CFLAGS = -ansi -I. -Iregexp $(CFLAGS_ADDTL)
LDFLAGS = -Lregexp LDFLAGS = -Lregexp
SNAPFILE = boxes-SNAP-$(shell date +%Y%m%d) GEN_HDR = parser.h
CLOGFILE = $(HOME)/d/public_html/software/boxes/changelogs.html GEN_SRC = parser.c lex.yy.c
GEN_FILES = $(GEN_SRC) $(GEN_HDR)
ORIG_HDRCL = boxes.h
ORIG_HDR = $(ORIG_HDRCL) lexer.h tools.h shape.h generate.h remove.h config.h
ORIG_GEN = lexer.l parser.y
ORIG_NORM = boxes.c tools.c shape.c generate.c remove.c
ORIG_SRC = $(ORIG_GEN) $(ORIG_NORM)
ORIG_FILES = $(ORIG_SRC) $(ORIG_HDR)
OTH_FILES = Makefile
ALL_CL = $(ORIG_SRC) $(ORIG_HDRCL) $(OTH_FILES)
ALL_FILES = $(ORIG_FILES) $(GEN_FILES) $(OTH_FILES)
ALL_OBJ = $(GEN_SRC:.c=.o) $(ORIG_NORM:.c=.o)
GENSRC = parser.c parser.h lex.yy.c
HS_CL = regexp/regexp.c regexp/regsub.c
HSSRC = $(HS_CL) regexp/regexp.h regexp/regmagic.h
ORIG_CL = boxes.c boxes.h lexer.l parser.y tools.c shape.c generate.c remove.c lexer.h
ORIGSRC = $(ORIG_CL) tools.h shape.h generate.h remove.h config.h
ALL_CL = $(ORIG_CL) $(HS_CL) Makefile boxes-config
ALLSRC = $(ORIGSRC) $(HSSRC) $(GENSRC)
ALLOBJ = parser.o lex.yy.o boxes.o shape.o tools.o generate.o remove.o
build: build:
$(MAKE) CFLAGS_ADDTL=-O boxes $(MAKE) CFLAGS_ADDTL=-O boxes
@ -111,8 +120,9 @@ build:
debug: debug:
$(MAKE) CFLAGS_ADDTL=-g boxes $(MAKE) CFLAGS_ADDTL=-g boxes
boxes: $(ALLOBJ) regexp/libregexp.a boxes: $(ALL_OBJ)
$(CC) $(LDFLAGS) $(ALLOBJ) -o boxes -lregexp $(MAKE) -C regexp CC=$(CC) libregexp.a
$(CC) $(LDFLAGS) $(ALL_OBJ) -o boxes -lregexp
parser.c parser.h: parser.y boxes.h regexp/regexp.h parser.c parser.h: parser.y boxes.h regexp/regexp.h
$(YACC) -o parser.c -d parser.y $(YACC) -o parser.c -d parser.y
@ -123,17 +133,9 @@ lex.yy.c: lexer.l boxes.h
cat lexer.tmp.c >> lex.yy.c cat lexer.tmp.c >> lex.yy.c
rm lexer.tmp.c rm lexer.tmp.c
regexp/libregexp.a: regexp/regexp.o regexp/regsub.o
ar cr regexp/libregexp.a regexp/regexp.o regexp/regsub.o
regexp/regexp.o: regexp/regexp.c regexp/regmagic.h regexp/regexp.h config.h
gcc -traditional -O -Iregexp -I. -o regexp/regexp.o -c regexp/regexp.c
regexp/regsub.o: regexp/regsub.c regexp/regmagic.h regexp/regexp.h config.h
gcc -traditional -O -Iregexp -I. -o regexp/regsub.o -c regexp/regsub.c
boxes.o: boxes.c boxes.h regexp/regexp.h shape.h tools.h generate.h remove.h config.h boxes.o: boxes.c boxes.h regexp/regexp.h shape.h tools.h generate.h remove.h config.h
tools.o: tools.c tools.h boxes.h shape.h config.h tools.o: tools.c tools.h boxes.h shape.h config.h
shape.o: shape.c shape.h boxes.h config.h shape.o: shape.c shape.h boxes.h config.h tools.h
generate.o: generate.c generate.h boxes.h shape.h tools.h config.h generate.o: generate.c generate.h boxes.h shape.h tools.h config.h
remove.o: remove.c remove.h boxes.h shape.h tools.h config.h remove.o: remove.c remove.h boxes.h shape.h tools.h config.h
lex.yy.o: lex.yy.c parser.h tools.h shape.h lexer.h config.h lex.yy.o: lex.yy.c parser.h tools.h shape.h lexer.h config.h
@ -142,24 +144,25 @@ parser.o: parser.c parser.h tools.h shape.h lexer.h config.h
.c.o: .c.o:
$(CC) $(CFLAGS) -Wall -W -c $< $(CC) $(CFLAGS) -Wall -W -c $<
snap: COPYING Makefile boxes-config $(ALLSRC) snap: $(ALL_FILES)
mkdir $(SNAPFILE) if [ -z "$(SNAPFILE)" ] ; then exit 1 ; fi
cp $(ALLSRC) Makefile $(SNAPFILE) mkdir $(SNAPFILE)/src
gtar cfvz $(SNAPFILE).tar.gz $(SNAPFILE)/* cp $(ALL_FILES) $(SNAPFILE)/src
rm -rf $(SNAPFILE)/ touch $(patsubst %,$(SNAPFILE)/src/%,$(GEN_FILES))
cp $(SNAPFILE).tar.gz $(HOME)/d/public_html/software/boxes/download/ $(MAKE) -C regexp SNAPFILE=../$(SNAPFILE) snap
rm -f $(HOME)/d/public_html/software/boxes/download/current-SNAP.tar.gz
(cd $(HOME)/d/public_html/software/boxes/download/; ln -s $(SNAPFILE).tar.gz current-SNAP.tar.gz)
rcstest: rcstest:
-for i in $(ALLSRC) Makefile boxes-config ; do rcsdiff $$i ; done -for i in $(ORIG_FILES) $(OTH_FILES) ; do rcsdiff $$i ; done
$(MAKE) -C regexp rcstest
logpage: $(ALL_CL) logpage: $(ALL_CL)
doc/create_changelog.pl $(ALL_CL) > $(CLOGFILE) @echo $(ALL_CL) $(shell $(MAKE) -C regexp -s logpage)
clean: clean:
rm -f $(ALLOBJ) rm -f $(ALL_OBJ)
rm -f core regexp/libregexp.a boxes rm -f $(GEN_FILES)
rm -f core boxes
$(MAKE) -C regexp clean
love: love:
@echo "Not in front of the kids, honey!" @echo "Not in front of the kids, honey!"