From 22fa70695a694f7b7ae910adc3601962d13c16ac Mon Sep 17 00:00:00 2001 From: gdr-ftp Date: Tue, 17 Feb 1998 00:26:27 +0000 Subject: [PATCH] binconst.mk: - changed definition of OBJS to remove the full pathnames and to add to previous values of OBJS rather than to act as a default value binrules.mk: - backed out all v1.5 changes except for using $(MAINSRC) vice $(MAIN).c - added a recipe for building ProDOS-renamed object files paths.mk: - backed out v1.6 changes - added a macro, PRODOS_OBJS. If this is set to "true", then ProDOS-compliant file names will be used for object files. --- binconst.mk | 13 +++++++++---- binrules.mk | 17 ++++++++--------- paths.mk | 13 ++++++++++++- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/binconst.mk b/binconst.mk index b3f3abd..86573cf 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.6 1998/02/15 19:43:57 gdr-ftp Exp $ +# $Id: binconst.mk,v 1.7 1998/02/17 00:26:24 gdr-ftp Exp $ # # Devin Reade, 1997. # @@ -41,6 +41,11 @@ DESC *= $(PROG).desc MAN1SFX = 1G .END -# Define all object files as being in the /obj hierarchy. -OBJS *= $(OBJ_DIR){$(SRCS:b)}.o - +# Objects are source file names with [.c|.asm] changed to .o +# If we're keeping object files on a ProDOS partition, change the +# '_' characters in file names to '.' +.IF $(PRODOS_OBJS) == true + OBJS += {$(SRCS:b:s/_/./g)}.o +.ELSE + OBJS += {$(SRCS:b)}.o +.END diff --git a/binrules.mk b/binrules.mk index e2f71ed..22a01f0 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.5 1998/02/15 19:44:00 gdr-ftp Exp $ +# $Id: binrules.mk,v 1.6 1998/02/17 00:26:25 gdr-ftp Exp $ # # Devin Reade, Dave Tribby, 1997. # @@ -18,16 +18,15 @@ $(OBJ_DIR): # Include standard occ options # -a0: use .o suffix for object file # -c: don't link after compiling -$(OBJ_DIR)$(MAIN).o: $(MAINSRC) +$(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 @@ -41,7 +40,7 @@ clean: 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) $< +# Implicit rule to handle ProDOS-renamed object files +%.o: %.O; +%.O .PRECIOUS : $$(@:b:s/./_/g).c + $(CC) -o $(OBJ_DIR)$*.o $(CFLAGS) -c $< diff --git a/paths.mk b/paths.mk index 0c799af..18b33ef 100644 --- a/paths.mk +++ b/paths.mk @@ -7,9 +7,15 @@ # # Devin Reade, 1997 # -# $Id: paths.mk,v 1.6 1998/02/15 19:44:01 gdr-ftp Exp $ +# $Id: paths.mk,v 1.7 1998/02/17 00:26:27 gdr-ftp Exp $ # +# This one isn't really a path, but it affects the creation of path +# names. If PRODOS_OBJS is set to "true" (minus the quotes), then the +# created object files will follow ProDOS naming conventions. + +PRODOS_OBJS = true + # SRC_DIR is the top-level GNO source distribution directory (containing # $(SRC_DIR)/gno, $(SRC_DIR)/gno/lib, and so forth). It also corresponds # to the top level of the CVS repository. @@ -25,6 +31,11 @@ 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.