 # Unix makefile for cpp  # ; # The redefinition of strchr() and strrchr() are needed for 8 # Ultrix-32, Unix 4.2 bsd (and maybe some other Unices). # + BSDDEFINE = -Dstrchr=index -Dstrrchr=rindex # E # On certain systems, such as Unix System III, you may need to define J # $(LINTFLAGS) in the make command line to set system-specific lint flags. #nE # This Makefile assumes cpp will replace the "standard" preprocessor. H # Delete the reference to -DLINE_PREFIX=\"\" if cpp is used stand-alone.I # LINEFIX is a sed script filter that reinserts #line -- used for testingdH # if LINE_PREFIX is set to "".   Note that we must stand on our heads toG # match the # and a line had better not begin with $.  By the way, whatr # we really want is  #	LINEFIX = | sed "s/^#/#line/"d #n CPPDEFINE = -DLINE_PREFIX=\"\"& LINEFIX = | sed "s/^[^ !\"%-~]/&line/" #gB # Define OLD_PREPROCESSOR non-zero to make a preprocessor which isA # "as compatible as possible" with the standard Unix V7 or UltrixuC # preprocessors.  This is needed to rebuild 4.2bsd, for example, asnC # the preprocessor is used to modify assembler code, rather than C. D # This is not recommended for current development.  OLD_PREPROCESSOR# # forces the following definitions:r2 #   OK_DOLLAR		FALSE	$ is not allowed in variables0 #   OK_CONCAT		FALSE	# cannot concatenate tokens: #   COMMENT_INVISIBLE	TRUE	old-style comment concatenation1 #   STRING_FORMAL	TRUE	old-style string expansione #   OLDDEFINE = -DOLD_PREPROCESSOR=1 #r4 # DEFINES collects all -D arguments for cc and lint:9 # Change DEFINES = $(BSDDEFINE) $(CPPDEFINE) $(OLDDEFINE)i  # for an old-style preprocessor. # # DEFINES = $(BSDDEFINE) $(CPPDEFINE)e   CFLAGS = -O $(DEFINES)   #  # ** compile cpp #d0 SRCS = cpp1.c cpp2.c cpp3.c cpp4.c cpp5.c cpp6.c0 OBJS = cpp1.o cpp2.o cpp3.o cpp4.o cpp5.o cpp6.o cpp: $(OBJS) 	$(CC) $(CFLAGS) $(OBJS) -o cpps   #c # ** manual page # 
 man:	cpp.1 	nroff -man cpp.1 >cpp.man   #s< # ** Test cpp by preprocessing itself, compiling the result,? # ** repeating the process and diff'ing the result.  Note: thisE: # ** is not a good test of cpp, but a simple verification.. # ** The diff's should not report any changes.< # ** Note that a sed script may be executed for each compile #p test:2" 	cpp cpp1.c $(LINEFIX) >old.tmp1.c" 	cpp cpp2.c $(LINEFIX) >old.tmp2.c" 	cpp cpp3.c $(LINEFIX) >old.tmp3.c" 	cpp cpp4.c $(LINEFIX) >old.tmp4.c" 	cpp cpp5.c $(LINEFIX) >old.tmp5.c" 	cpp cpp6.c $(LINEFIX) >old.tmp6.c" 	$(CC) $(CFLAGS) old.tmp[123456].c 	a.out cpp1.c >new.tmp1.cg 	a.out cpp2.c >new.tmp2.ch 	a.out cpp3.c >new.tmp3.c* 	a.out cpp4.c >new.tmp4.c  	a.out cpp5.c >new.tmp5.c  	a.out cpp6.c >new.tmp6.cr 	diff old.tmp1.c new.tmp1.c  	diff old.tmp2.c new.tmp2.cu 	diff old.tmp3.c new.tmp3.ct 	diff old.tmp4.c new.tmp4.cl 	diff old.tmp5.c new.tmp5.cI 	diff old.tmp6.c new.tmp6.c(- 	rm a.out old.tmp[123456].* new.tmp[123456].*l   #4; # A somewhat more extensive test is provided by the "clock")? # program (which is not distributed).  Substitute your favoriten # macro-rich program here. #t clock:	clock.c cpp# 	cpp clock.c $(LINEFIX) >temp.cpp.cp* 	cc temp.cpp.c -lcurses -ltermcap -o clock 	rm temp.cpp.c   #f # ** Lint the code #   
 lint:	$(SRCS)c% 	lint $(LINTFLAGS) $(DEFINES) $(SRCS).   #d # ** Remove unneeded files #f clean: 	rm -f $(OBJS) cpp   #l7 # ** Rebuild the archive files needed to distribute cpp[& # ** Uses the Decus C archive utility. #v   archc:	archc.c! 	$(CC) $(CFLAGS) archc.c -o archci   archx:	archx.c! 	$(CC) $(CFLAGS) archx.c -o archxr   archive: archc9 	archc readme.txt cpp.mem archx.c archc.c cpp.rno cpp.1 \p 		makefile.txt cpp*.h >cpp1.arce% 	archc cpp1.c cpp2.c cpp3.c >cpp2.arc % 	archc cpp4.c cpp5.c cpp6.c >cpp3.arc    #  # Object module dependencies #    cpp1.o	:	cpp1.c cpp.h cppdef.h   cpp2.o	:	cpp2.c cpp.h cppdef.h   cpp3.o	:	cpp3.c cpp.h cppdef.h   cpp4.o	:	cpp4.c cpp.h cppdef.h   cpp5.o	:	cpp5.c cpp.h cppdef.h   cpp6.o	:	cpp6.c cpp.h cppdef.h   cpp.man	:	cpp.1h    