1997-08-08 04:44:13 +00:00
|
|
|
#
|
|
|
|
# Standard compilation rules for utilities (directories ./bin, ./sbin,
|
|
|
|
# ./usr.bin, ./usr.sbin). These are not used when building the libraries.
|
|
|
|
#
|
1998-02-17 00:26:27 +00:00
|
|
|
# $Id: binrules.mk,v 1.6 1998/02/17 00:26:25 gdr-ftp Exp $
|
1997-08-08 04:44:13 +00:00
|
|
|
#
|
1997-09-24 06:43:53 +00:00
|
|
|
# Devin Reade, Dave Tribby, 1997.
|
1997-08-08 04:44:13 +00:00
|
|
|
#
|
|
|
|
|
1997-09-24 06:43:53 +00:00
|
|
|
# Default target, "build," generates the program file
|
1998-02-09 08:45:21 +00:00
|
|
|
build: $(OBJ_DIR) $(OBJ_DIR)$(PROG)
|
|
|
|
|
|
|
|
# create the object directory hierarchy if necessary
|
|
|
|
$(OBJ_DIR):
|
|
|
|
$(INSTALL) -d $(OBJ_DIR)
|
1997-08-08 04:44:13 +00:00
|
|
|
|
1997-09-24 06:43:53 +00:00
|
|
|
# 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
|
1998-02-17 00:26:27 +00:00
|
|
|
$(MAIN).o: $(MAINSRC)
|
1998-02-15 19:44:03 +00:00
|
|
|
$(CC) -o $@ $(CFLAGS:s/ -r / /) -a0 -c $(MAINSRC)
|
1997-09-24 06:43:53 +00:00
|
|
|
|
|
|
|
# Program depends upon all the objects. Add the version resource.
|
1998-02-09 08:45:21 +00:00
|
|
|
$(OBJ_DIR)$(PROG): $(OBJS)
|
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(LDLIBS)
|
|
|
|
$(CATREZ) -d $@ $(OBJ_DIR)$(PROG).r
|
1998-02-17 00:26:27 +00:00
|
|
|
$(OBJ_DIR)$(PROG): $(PROG).r
|
|
|
|
|
1997-09-24 06:43:53 +00:00
|
|
|
# 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
|
1997-08-08 04:44:13 +00:00
|
|
|
clean:
|
1998-02-09 08:45:21 +00:00
|
|
|
-$(RM) -f $(OBJ_DIR){$(OBJS)}
|
|
|
|
-$(RM) -f $(OBJ_DIR)$(MAIN).root
|
|
|
|
-$(RM) -f $(OBJ_DIR)$(PROG).r
|
1997-09-24 06:43:53 +00:00
|
|
|
-$(RM) -f $(PROG).rej
|
1997-08-08 04:44:13 +00:00
|
|
|
|
1997-09-24 06:43:53 +00:00
|
|
|
# Remove intermediate files and program file
|
1997-08-08 04:44:13 +00:00
|
|
|
clobber: clean
|
1998-02-09 08:45:21 +00:00
|
|
|
-$(RM) $(OBJ_DIR)$(PROG)
|
1998-02-15 19:44:03 +00:00
|
|
|
|
1998-02-17 00:26:27 +00:00
|
|
|
# Implicit rule to handle ProDOS-renamed object files
|
|
|
|
%.o: %.O;
|
|
|
|
%.O .PRECIOUS : $$(@:b:s/./_/g).c
|
|
|
|
$(CC) -o $(OBJ_DIR)$*.o $(CFLAGS) -c $<
|