From 8774b23e30a0979dd561f60aca55726c6036cf36 Mon Sep 17 00:00:00 2001 From: gdr Date: Wed, 24 Sep 1997 06:43:53 +0000 Subject: [PATCH] - got binrules.mk, binconst.mk, and prog.mk working together properly - reduce the number of shell meta characters in recipes - use catrez instead of copyfork --- binconst.mk | 19 +++++++++-------- binrules.mk | 31 ++++++++++++++++++++-------- prog.mk | 59 ++++++++--------------------------------------------- 3 files changed, 41 insertions(+), 68 deletions(-) diff --git a/binconst.mk b/binconst.mk index dfdd4d4..7661661 100644 --- a/binconst.mk +++ b/binconst.mk @@ -2,24 +2,27 @@ # Compilation constants for utilities (directories ./bin, ./sbin, # ./usr.bin, ./usr.sbin). These are not used when building the libraries. # -# $Id: binconst.mk,v 1.1 1997/08/08 04:44:13 gdr Exp $ +# $Id: binconst.mk,v 1.2 1997/09/24 06:43:52 gdr Exp $ # # Devin Reade, 1997. # DEFINES += -CFLAGS += -v -w -LDFLAGS += -v +CFLAGS += -w +LDFLAGS += LDLIBS += -COPYFORK = /usr/orca/bin/copyfork -INSTALL = /usr/bin/install +# WARNING: You *must* use descu v1.0.4 or later for these builds. DESCU = /usr/sbin/descu +COPYFORK = /usr/orca/bin/copyfork +CATREZ = /usr/bin/catrez +INSTALL = /usr/bin/install -# This is the created source file for the describe(1) database. -DESC_SRC = $(RELEASE_DIR)/usr/lib/describe.src +# $(DESC_SRC) is the created source file for the describe(1) database. +DESC_DIR = $(RELEASE_DIR)/usr/lib +DESC_SRC = $(DESC_DIR)/describe.src -# Define SRCS if it's not already done. +# If no source files were defined, use program name .IF $(SRCS) == $(NULL) SRCS = $(PROG).c .END diff --git a/binrules.mk b/binrules.mk index 13db2dd..b5000a4 100644 --- a/binrules.mk +++ b/binrules.mk @@ -2,22 +2,35 @@ # Standard compilation rules for utilities (directories ./bin, ./sbin, # ./usr.bin, ./usr.sbin). These are not used when building the libraries. # -# $Id: binrules.mk,v 1.1 1997/08/08 04:44:13 gdr Exp $ +# $Id: binrules.mk,v 1.2 1997/09/24 06:43:53 gdr Exp $ # -# Devin Reade, 1997. +# Devin Reade, Dave Tribby, 1997. # -build: $(PROG) +# Default target, "build," generates the program file +build: $(PROG) +# Create the main program file with a ".root" and set the stack size. +# Include standard occ options +# -a0: use .o suffix for object file +# -c: don't link after compiling +$(PROG).o: $(PROG).c + $(CC) $(CFLAGS:s/ -r / /) -a0 -c $(PROG).c + +# Program depends upon all the objects. Add the version resource. $(PROG): $(OBJS) $(PROG).r $(CC) -o $@ $(LDFLAGS) $(OBJS) $(LDLIBS) - $(COPYFORK) $(PROG).r $@ -r - + $(CATREZ) -d $@ $(PROG).r + +# Remove intermediate files. If we don't put shell meta characters in +# here, then dmake doesn't have to start up a subshell and can instead +# exec the line directly clean: - -$(RM) -f *.o - -$(RM) -f *.root - -$(RM) -f *.r - -$(RM) -f *.rej + -$(RM) -f $(OBJS) + -$(RM) -f $(PROG).root + -$(RM) -f $(PROG).r + -$(RM) -f $(PROG).rej +# Remove intermediate files and program file clobber: clean -$(RM) $(PROG) diff --git a/prog.mk b/prog.mk index 3cd3277..96dfe8d 100644 --- a/prog.mk +++ b/prog.mk @@ -1,5 +1,7 @@ # -# gno.prog.mk version 1.1.0 (August 31, 1997) +# prog.mk version 1.1.0 (August 31, 1997) +# +# $Id: prog.mk,v 1.2 1997/09/24 06:43:53 gdr Exp $ # # This makefile is intended for use with dmake(1) and occ(1) on Apple IIGS @@ -35,24 +37,16 @@ # stack size to 4096, and to set the "__STACK_CHECK__" macro: # dmake DEBUG=25 STACK=4096 DEFINES=-D__STACK_CHECK__ - # # Created by Dave Tribby, July 1997 # -.INCLUDE: - -.INCLUDE: - -# If no source files were defined, use program name -.IF $(SRCS) == $(NULL) - SRCS = $(PROG).c -.END +.INCLUDE: /src/gno/paths.mk +.INCLUDE: /src/gno/binconst.mk # Objects are source file names with .c changed to .o OBJS=$(SRCS:s/.c/.o/:f) - # # Check for user-specified compile/load options # @@ -72,7 +66,6 @@ OBJS=$(SRCS:s/.c/.o/:f) STACK = 768 .END - # Compile and load flags passed to occ # -r: don't create .root file (used on all but main file) CFLAGS += -r -O$(OPTIMIZE) $(DEFINES) -s$(STACK) @@ -89,48 +82,12 @@ CFLAGS += -r -O$(OPTIMIZE) $(DEFINES) -s$(STACK) RELBIN = $(RELEASE_DIR)$(BINDIR) RELMAN = $(RELEASE_DIR)$(MANDIR) -### ------------------------------------------------------------ -### The following section could be replaced by if -### a few minor changes were made to - -CATREZ = /usr/local/bin/catrez - - -# Default target, "build," generates the program file -build: $(PROG) - -# Create the main program file with a ".root" and set the stack size. -# Include standard occ options -# -a0: use .o suffix for object file -# -c: don't link after compiling -$(PROG).o: $(PROG).c - $(CC) $(CFLAGS:s/ -r / /) -a0 -c $(PROG).c - -# Program depends upon all the objects. Add the version resource. -$(PROG): $(OBJS) $(PROG).r - $(CC) -o $@ $(LDFLAGS) $(OBJS) $(LDLIBS) - $(CATREZ) -d $@ $(PROG).r - -# Remove intermediate files -clean: - -$(RM) -f *.o - -$(RM) -f *.root - -$(RM) -f *.r - -$(RM) -f *.rej - -# Remove intermediate files and program file -clobber: clean - -$(RM) $(PROG) - -### End of section that could be replaced by -### ------------------------------------------------------------ - +.INCLUDE: /src/gno/binrules.mk # Place files where they will subsequently be archived in a binary # distribution. release: - $(INSTALL) -d $(RELBIN) $(RELMAN)/man1 + $(INSTALL) -d $(RELBIN) $(RELMAN)/man1 $(DESC_DIR) $(INSTALL) $(PROG) $(RELBIN) $(INSTALL) $(PROG).1 $(RELMAN)/man1 - $(DESCU) $(DESC_SRC) $(DESC) > /tmp/describe.src - $(MV) /tmp/describe.src $(DESC_SRC) + $(DESCU) -o $(DESC_SRC) $(DESC_SRC) $(DESC)