From 150b2eb2e23f8ad0c4eeef0746507eb82c7b0900 Mon Sep 17 00:00:00 2001 From: gdr-ftp Date: Sun, 15 Feb 1998 19:44:03 +0000 Subject: [PATCH] paths.mk: - with the modified binrules.mk, we don't need the .SOURCE directives. binconst.mk: - change the definition of OBJS somewhat so that they are always fully pathed in the $(OBJ_DIR) directory - for utils with both BSD and GNO man pages, make sure we install the GNO one - conditionally define MAINSRC so that we can override it if necessary. By default MAINSRC is $(MAIN).c binrules.mk: - don't assume MAINSRC is $(MAIN).c - don't assume the compiled rez fork is in the current directory - add default target for creating object files in the $(OBJ_DIR) directory - don't relink the executable if it just needs a new resource fork binrelease.mk: - changed targets to allow for the BSD/GNO man page duality - assume the built program is in the $(OBJ_DIR) - eliminate describe actions from the 'install' target prog.mk: - don't include binrules.mk if CUSTOM_RULES is defined and non-NULL. --- binconst.mk | 17 ++++++++++++++--- binrelease.mk | 16 ++++++++-------- binrules.mk | 16 +++++++++++----- paths.mk | 7 +------ prog.mk | 5 +++-- 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/binconst.mk b/binconst.mk index df0c76e..b3f3abd 100644 --- a/binconst.mk +++ b/binconst.mk @@ -2,7 +2,7 @@ # Compilation constants for utilities (directories ./bin, ./sbin, # ./usr.bin, ./usr.sbin). These are not used when building the libraries. # -# $Id: binconst.mk,v 1.5 1998/02/09 08:43:44 taubert Exp $ +# $Id: binconst.mk,v 1.6 1998/02/15 19:43:57 gdr-ftp Exp $ # # Devin Reade, 1997. # @@ -27,9 +27,20 @@ SRCS *= $(PROG).c # If no main file was defined, use program name MAIN *= $(PROG) +MAINSRC *= $(MAIN).c # Define DESC if it's not already done. DESC *= $(PROG).desc -# Objects are source file names with .c changed to .o -OBJS += $(SRCS:s/.c/.o/:f) +# Some utils have both an original BSD man page and a GNO formatted one. +# If HAS_BSD_MANPAGE has been set, then the GNO page ends in ".1G", else +# it ends in ".1" +.IF $(HAS_BSD_MANPAGE) == $(NULL) + MAN1SFX = 1 +.ELSE + MAN1SFX = 1G +.END + +# Define all object files as being in the /obj hierarchy. +OBJS *= $(OBJ_DIR){$(SRCS:b)}.o + diff --git a/binrelease.mk b/binrelease.mk index e43a823..ce3dc13 100644 --- a/binrelease.mk +++ b/binrelease.mk @@ -3,20 +3,20 @@ # typical user programs. They are likely not suitable for system # daemons, etc. # -# $Id: binrelease.mk,v 1.1 1997/10/30 04:26:58 gdr Exp $ +# $Id: binrelease.mk,v 1.2 1998/02/15 19:43:58 gdr-ftp Exp $ # # Place files where they will subsequently be archived in a binary # distribution. -release: $(PROG) $(PROG).1 $(DESC) +release: $(OBJ_DIR)$(PROG) $(PROG).$(MAN1SFX) $(DESC) $(INSTALL) -d $(RELBIN) $(RELMAN)/man1 $(DESC_DIR) - $(INSTALL) $(PROG) $(RELBIN) - $(INSTALL) $(PROG).1 $(RELMAN)/man1 + $(INSTALL) $(OBJ_DIR)$(PROG) $(RELBIN) + $(INSTALL) $(PROG).$(MAN1SFX) $(RELMAN)/man1/$(PROG).1 $(DESCU) -o $(DESC_SRC) $(DESC_SRC) $(DESC) # Install files into a live system. This doesn't update the describe # database. -install: $(PROG) $(PROG).1 $(DESC) - $(INSTALL) -d $(BINDIR) $(MANDIR)/man1 $(DESC_DIR) - $(INSTALL) $(PROG) $(BINDIR) - $(INSTALL) $(PROG).1 $(MANDIR)/man1 +install: $(OBJ_DIR)$(PROG) $(PROG).$(MAN1SFX) + $(INSTALL) -d $(BINDIR) $(MANDIR)/man1 + $(INSTALL) $(OBJ_DIR)$(PROG) $(BINDIR) + $(INSTALL) $(PROG).$(MAN1SFX) $(MANDIR)/man1/$(PROG).1 diff --git a/binrules.mk b/binrules.mk index fd9d9b4..e2f71ed 100644 --- a/binrules.mk +++ b/binrules.mk @@ -2,7 +2,7 @@ # 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.4 1998/02/09 08:43:46 taubert Exp $ +# $Id: binrules.mk,v 1.5 1998/02/15 19:44:00 gdr-ftp Exp $ # # Devin Reade, Dave Tribby, 1997. # @@ -18,15 +18,16 @@ $(OBJ_DIR): # Include standard occ options # -a0: use .o suffix for object file # -c: don't link after compiling -$(MAIN).o: $(MAIN).c - $(CC) -o $@ $(CFLAGS:s/ -r / /) -a0 -c $(MAIN).c +$(OBJ_DIR)$(MAIN).o: $(MAINSRC) + $(CC) -o $@ $(CFLAGS:s/ -r / /) -a0 -c $(MAINSRC) # Program depends upon all the objects. Add the version resource. $(OBJ_DIR)$(PROG): $(OBJS) $(CC) -o $@ $(LDFLAGS) $< $(LDLIBS) + +$(OBJ_DIR)$(PROG):: $(OBJ_DIR)$(PROG).r $(CATREZ) -d $@ $(OBJ_DIR)$(PROG).r -$(OBJ_DIR)$(PROG): $(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 @@ -39,3 +40,8 @@ clean: # Remove intermediate files and program file clobber: clean -$(RM) $(OBJ_DIR)$(PROG) + +# Default target for object files +$(OBJ_DIR)%.o: %.c ; $(CC) -o $@ $(CFLAGS) -a0 -c $< +$(OBJ_DIR)%.o: %.asm ; $(AS) -o $@ $(ASFLAGS) -a0 -c $< +$(OBJ_DIR)%.r: %.rez; $(REZ) -o $@ $(REZFLAGS) $< diff --git a/paths.mk b/paths.mk index 8bf1aed..0c799af 100644 --- a/paths.mk +++ b/paths.mk @@ -7,7 +7,7 @@ # # Devin Reade, 1997 # -# $Id: paths.mk,v 1.5 1998/02/09 08:43:47 taubert Exp $ +# $Id: paths.mk,v 1.6 1998/02/15 19:44:01 gdr-ftp Exp $ # # SRC_DIR is the top-level GNO source distribution directory (containing @@ -25,11 +25,6 @@ SRC_DIR = /src CWD = $(PWD:s,:,/,g) OBJ_DIR = /obj$(CWD:s,${SRC_DIR},,) -.SOURCE.a : $(OBJ_DIR) -.SOURCE.o : $(OBJ_DIR) -.SOURCE.r : $(OBJ_DIR) -.SOURCE.root : $(OBJ_DIR) - # RELEASE_DIR is the directory into which we will put the created # distribution files. # I recommend using /dist and defining it in /etc/namespace. diff --git a/prog.mk b/prog.mk index 5543cfc..9ffe1f4 100644 --- a/prog.mk +++ b/prog.mk @@ -1,7 +1,7 @@ # # prog.mk version 1.1.0 (August 31, 1997) # -# $Id: prog.mk,v 1.5 1998/02/09 08:43:49 taubert Exp $ +# $Id: prog.mk,v 1.6 1998/02/15 19:44:03 gdr-ftp Exp $ # # This makefile is intended for use with dmake(1) and occ(1) on Apple IIGS @@ -59,7 +59,6 @@ STACK *= 1024 # -r: don't create .root file (used on all but main file) CFLAGS += -r -O$(OPTIMIZE) $(DEFINES) -s$(STACK) - # If installation directories were not set, use defaults BINDIR *= /bin MANDIR *= /usr/man @@ -67,7 +66,9 @@ MANDIR *= /usr/man RELBIN = $(RELEASE_DIR)$(BINDIR) RELMAN = $(RELEASE_DIR)$(MANDIR) +.IF $(CUSTOM_RULES) == $(NULL) .INCLUDE: /src/gno/binrules.mk +.END .IF $(CUSTOM_RELEASE) == $(NULL) .INCLUDE: /src/gno/binrelease.mk