Added support for separate object hierarchy and cleaned up libc makefiles

This commit is contained in:
taubert 1998-02-09 08:45:21 +00:00
parent e0a16a3570
commit 6bd94b0884
18 changed files with 139 additions and 206 deletions

View File

@ -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.4 1998/01/24 07:35:15 taubert Exp $
# $Id: binconst.mk,v 1.5 1998/02/09 08:43:44 taubert Exp $
#
# Devin Reade, 1997.
#
@ -10,7 +10,7 @@
DEFINES +=
CFLAGS += -w
LDFLAGS +=
LDLIBS += $(LDADD:s/-l/-l:usr:lib:lib/)
LDLIBS += $(LDADD:s,-l,-l/usr/lib/lib,)
# WARNING: You *must* use descu v1.0.4 or later for these builds.
DESCU = /usr/sbin/descu
@ -23,18 +23,13 @@ DESC_DIR = $(RELEASE_DIR)/usr/lib
DESC_SRC = $(DESC_DIR)/describe.src
# If no source files were defined, use program name
.IF $(SRCS) == $(NULL)
SRCS = $(PROG).c
.END
SRCS *= $(PROG).c
# If no main file was defined, use program name
.IF $(MAIN) == $(NULL)
MAIN = $(PROG)
.END
MAIN *= $(PROG)
# Define DESC if it's not already done.
.IF $(DESC) == $(NULL)
DESC = $(PROG).desc
.END
DESC *= $(PROG).desc
OBJS = $(SRCS:s/.c/.o/:f)
# Objects are source file names with .c changed to .o
OBJS += $(SRCS:s/.c/.o/:f)

View File

@ -2,35 +2,40 @@
# 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.3 1997/11/01 19:10:37 gdr Exp $
# $Id: binrules.mk,v 1.4 1998/02/09 08:43:46 taubert Exp $
#
# Devin Reade, Dave Tribby, 1997.
#
# Default target, "build," generates the program file
build: $(PROG)
build: $(OBJ_DIR) $(OBJ_DIR)$(PROG)
# create the object directory hierarchy if necessary
$(OBJ_DIR):
$(INSTALL) -d $(OBJ_DIR)
# 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
$(MAIN).o: $(MAIN).c
$(CC) $(CFLAGS:s/ -r / /) -a0 -c $(MAIN).c
$(CC) -o $@ $(CFLAGS:s/ -r / /) -a0 -c $(MAIN).c
# Program depends upon all the objects. Add the version resource.
$(PROG): $(OBJS) $(PROG).r
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LDLIBS)
$(CATREZ) -d $@ $(PROG).r
$(OBJ_DIR)$(PROG): $(OBJS)
$(CC) -o $@ $(LDFLAGS) $< $(LDLIBS)
$(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
clean:
-$(RM) -f $(OBJS)
-$(RM) -f $(MAIN).root
-$(RM) -f $(PROG).r
-$(RM) -f $(OBJ_DIR){$(OBJS)}
-$(RM) -f $(OBJ_DIR)$(MAIN).root
-$(RM) -f $(OBJ_DIR)$(PROG).r
-$(RM) -f $(PROG).rej
# Remove intermediate files and program file
clobber: clean
-$(RM) $(PROG)
-$(RM) $(OBJ_DIR)$(PROG)

View File

@ -1,24 +1,22 @@
# $Id: Makefile,v 1.1 1998/02/02 08:17:50 taubert Exp $
# $Id: Makefile,v 1.2 1998/02/09 08:43:52 taubert Exp $
.INCLUDE: /src/gno/paths.mk
all: modem printer null
all: $(OBJ_DIR)modem $(OBJ_DIR)printer $(OBJ_DIR)null
modem: port.o msccf.o
$(LD) $(LDFLAGS) -l libsim -o $@ $<
$(OBJ_DIR)modem: port.o msccf.o
$(LD) $(LDFLAGS) -l /usr/lib/libsim -o $@ $<
chtyp -t 187 -a 32257 $@
modem: libsim
printer: port.o psccf.o
$(LD) $(LDFLAGS) -l libsim -o $@ $<
$(OBJ_DIR)printer: port.o psccf.o
$(LD) $(LDFLAGS) -l /usr/lib/libsim -o $@ $<
chtyp -t 187 -a 32257 $@
printer: libsim
null: null.o
$(OBJ_DIR)null: null.o
$(LD) $(LDFLAGS) -o $@ $<
chtyp -t 187 -a 32257 $@
console: console.o inout.o box.root conpatch.o
$(OBJ_DIR)console: console.o inout.o box.root conpatch.o
$(LD) $(LDFLAGS) -o $@ $<
chtyp -t 187 -a 32257 $@

View File

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.1 1998/02/02 08:18:19 taubert Exp $
# $Id: Makefile,v 1.2 1998/02/09 08:43:55 taubert Exp $
.INCLUDE: /src/gno/paths.mk
@ -12,11 +12,16 @@ OBJS= main.o patch.o kern.o sys.o signal.o ctool.o sem.o \
CFLAGS+=-DKERNEL
.SOURCE: ../drivers
$(PROG): $(OBJS)
$(OBJ_DIR)$(PROG): $(OBJS)
gsh -c ${mktmp prefix 13 /lang/orca/libraries; $(LD) $(LDFLAGS) -o $@ $<}
compile +w $(PROG).rez keep=$@
chtyp -t s16 $@
$(PROG): $(PROG).rez
$(CP) $@ /ren/gno.new/kern.new
$(OBJ_DIR)$(PROG): $(PROG).rez
#%.o : %.c
# $(CC) $(CFLAGS) -c $< -o $@
# @gsh -c ${mktmp cd $(OBJ_DIR); nameobj -p $@}
# dependencies

View File

@ -6,7 +6,7 @@
#
# Devin Reade, 1997
#
# $Id: const.mk,v 1.5 1998/02/08 03:47:15 gdr-ftp Exp $
# $Id: const.mk,v 1.6 1998/02/09 08:43:58 taubert Exp $
#
# It is critical that 13/orcacdefs/defaults.h is set up correctly,
# including #defines for __appleiigs__ and __GNO__. For the purpose
@ -16,7 +16,7 @@
DEFINES +=
INCLUDES +=
ASFLAGS += -r -c
ASFLAGS += -r
CFLAGS += -r -w $(DEFINES) $(INCLUDES)
LDFLAGS +=
INSTALL = /usr/bin/install
@ -33,6 +33,6 @@ RELUSRLIB = $(RELEASE_DIR)$(USRLIBDIR)
MAKELIB = 17/makelib.apw
MAKELIBFLAGS = -w -r -p
# This is the name of the library we're building. We define LIBPFX if
# it's not in the current directory.
LIBTARGET = $(LIBPFX)lib$(LIB)
# This is the name of the library we're building.
LIBPFX *= $(OBJ_DIR)
LIBTARGET = $(LIBPFX)lib$(LIB)

View File

@ -1,12 +1,12 @@
#
# $Id: lib.mk,v 1.2 1998/02/08 03:47:17 gdr-ftp Exp $
# $Id: lib.mk,v 1.3 1998/02/09 08:44:01 taubert Exp $
#
.INCLUDE: /src/gno/paths.mk
.INCLUDE: /src/gno/lib/const.mk
# Objects are source file names with .c changed to .o
OBJS= $(SRCS:s/.c/.o/:f)
OBJS += $(SRCS:s/.c/.o/:f)
#
# Check for user-specified compile/load options
@ -18,19 +18,25 @@ OBJS= $(SRCS:s/.c/.o/:f)
.END
# Was special optimizing requested?
.IF $(OPTIMIZE) == $(NULL)
OPTIMIZE= 78
.END
OPTIMIZE*= 78
# Compile and load flags passed to occ
CFLAGS+= -O$(OPTIMIZE)
CFLAGS += -O$(OPTIMIZE)
# default target
build: $(LIBTARGET)
# build is the default target
build: $(OBJ_DIR) $(LIBTARGET)
# create the object directory hierarchy if necessary
$(OBJ_DIR):
$(INSTALL) -d $(OBJ_DIR)
# Update library with out of date object files
$(LIBTARGET): $(OBJS)
$(LIBTARGET) .PRECIOUS: $(OBJS)
$(MAKELIB) $(MAKELIBFLAGS) -l $@ $^
# Use "dmake force; dmake build" to update all the object files in a library
force: $(OBJS)
touch $<
.INCLUDE: /src/gno/lib/librelease.mk

View File

@ -10,26 +10,17 @@
#
# Devin Reade, 1997.
#
# $Id: Makefile,v 1.7 1998/02/08 03:47:22 gdr-ftp Exp $
# $Id: Makefile,v 1.8 1998/02/09 08:44:06 taubert Exp $
#
LIB = c
LIB= c
# assert.a must be copied from $(ORCA_SRC)/ORCALib/obj into $(OBJ_DIR)
OBJS= assert.a
.INCLUDE: ../../paths.mk
.INCLUDE: ../const.mk
# This library goes into /lib.
USE_SLASH_LIB= true
USE_SLASH_LIB = true # This library goes into /lib.
ORCALIB_OBJ = \
$(ORCA_SRC)/orcalib/obj/assert.a
libc: $(ORCALIB_OBJ)
$(MAKELIB) $(MAKELIBFLAGS) -l $@ $^
$(ORCALIB_OBJ):; true
.INCLUDE: ../librelease.mk
.INCLUDE: /src/gno/lib/lib.mk
$(LIBTARGET):: lib$(LIB).r
$(CATREZ) -d $@ lib$(LIB).r
$(CATREZ) -d $@ $<

View File

@ -1,25 +1,17 @@
#
# Makefile for libc/gen.
#
# $Id: Makefile,v 1.7 1998/02/09 08:25:39 taubert Exp $
# $Id: Makefile,v 1.8 1998/02/09 08:44:12 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJ_ASM=setjmp.o syslog.o
OBJ_C= basename.o bmem.o compat.o dirent.o err.o fnmatch.o fts.o \
getcwd.o getgrent.o getpass.o getpwent.o getttyent.o hostname.o \
oldlog.o popen.o psignal.o pwcache.o scandir.o siglist.o sleep.o \
tty.o utime.o
OBJ_ASM = setjmp.o syslog.o
OBJ_C = basename.o bmem.o compat.o dirent.o err.o fnmatch.o fts.o \
getcwd.o getgrent.o getpass.o getpwent.o getttyent.o hostname.o \
oldlog.o popen.o psignal.o pwcache.o scandir.o siglist.o sleep.o \
tty.o utime.o
OBJS= $(OBJ_ASM) $(OBJ_C)
OBJS = $(OBJ_ASM) $(OBJ_C)
CFLAGS += -O78
build .PHONY: ../libc
obj: $(OBJS)
asm: $(OBJ_ASM)
c: $(OBJ_C)
.INCLUDE: ../rules.mk
.INCLUDE: /src/gno/lib/lib.mk

View File

@ -1,26 +1,19 @@
#
# gno/libc/gno/Makefile
#
# Devin Reade, 1996
#
# $Id: Makefile,v 1.5 1997/12/21 20:11:17 gdr Exp $
# $Id: Makefile,v 1.6 1998/02/09 08:44:20 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
OBJ_ASM = gnocmd.o parsearg.o stack.o
OBJ_C = gnomisc.o gsstring.o map.o stack2.o
OBJS = $(OBJ_ASM) $(OBJ_C)
CFLAGS += -O78
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJ_ASM=gnocmd.o parsearg.o stack.o
OBJ_C= gnomisc.o gsstring.o map.o stack2.o
OBJS= $(OBJ_ASM) $(OBJ_C)
MACROS_ORCA = $(ORCA_DIST)/OrcaInclude
MACRO_FILES = $(MACROS_ORCA)/m16.tools $(MACROS_ORCA)/m16.orca
build .PHONY: ../libc
obj: $(OBJS)
.INCLUDE: /src/gno/lib/lib.mk
stack.mac:
macgen -p stack.asm $@ $(MACRO_FILES)
@ -28,8 +21,6 @@ stack.mac:
clean clobber:
$(RM) -f $(OBJS) stack.mac
.INCLUDE: ../rules.mk
gnocmd.o:: gnocmd.mac
parsearg.o:: parsearg.mac
stack.o:: stack.mac

View File

@ -1,18 +1,11 @@
#
# gno/lib/libc/locale/Makefile
#
# Devin Reade, 1997
#
# $Id: Makefile,v 1.4 1997/10/03 04:44:24 gdr Exp $
# $Id: Makefile,v 1.5 1998/02/09 08:44:28 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJS= table.o
OBJS = table.o
CFLAGS += -O78
build .PHONY: ../libc
obj: $(OBJS)
.INCLUDE: ../rules.mk
.INCLUDE: /src/gno/lib/lib.mk

View File

@ -1,22 +1,16 @@
#
# $Id: Makefile,v 1.2 1997/11/17 04:13:07 gdr Exp $
#
# Devin Reade, October 1997.
# $Id: Makefile,v 1.3 1998/02/09 08:44:37 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
OBJS = regcomp.o regerror.o regexec.o regfree.o
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJS= regcomp.o regerror.o regexec.o regfree.o
# I've not bothered to determine what POSIX_MISTAKE means, but 4.4BSD
# uses it.
CFLAGS += -v -r -DPOSIX_MISTAKE
build .PHONY: ../libc
obj: $(OBJS)
.INCLUDE: ../rules.mk
.INCLUDE: /src/gno/lib/lib.mk
regcomp.o:: cclass.h cname.h regex2.h utils.h
regerror.o:: utils.h

View File

@ -1,15 +1,12 @@
#
# gno/lib/libc/stdio/Makefile
#
# Devin Reade, 1997
#
# $Id: Makefile,v 1.9 1998/01/26 00:44:25 gdr-ftp Exp $
# $Id: Makefile,v 1.10 1998/02/09 08:44:46 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
OBJS = clrerr.o fclose.o fdopen.o feof.o ferror.o fflush.o fgetc.o \
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJS= clrerr.o fclose.o fdopen.o feof.o ferror.o fflush.o fgetc.o \
fgetln.o fgetpos.o fgets.o fileno.o findfp.o flags.o fopen.o \
fprintf.o fpurge.o fputc.o fputs.o fread.o freopen.o fscanf.o \
fseek.o fsetpos.o ftell.o funopen.o fvwrite.o fwalk.o fwrite.o \
@ -20,11 +17,6 @@ OBJS = clrerr.o fclose.o fdopen.o feof.o ferror.o fflush.o fgetc.o \
vprintf.o vscanf.o vsnprintf.o vsprintf.o vsscanf.o wbuf.o wsetup.o \
vfprintf1.o vfprintf2.o
CFLAGS += -O78
build .PHONY: ../libc
obj: $(OBJS)
#
# There is a problem with ORCA/C v2.1.1b2 (and likely earlier versions)
# that keeps it from compiling vfprintf.c. Instead the machine crashes.
@ -38,8 +30,10 @@ obj: $(OBJS)
JINCL = -I/usr/include -I/lang/orca/libraries/orcacdefs
JDEFS = -D__ORCAC__ -D__appleiigs__ -D__GNO__ -DSPLIT_FILE_2
.INCLUDE: /src/gno/lib/lib.mk
junk.c: vfprintf.c
gsh -c ${mktmp cpp $(JINCL) $(JDEFS) $< > $@}
gsh -c ${mktmp cpp $(JINCL) $(JDEFS) $< > 14/junk.c; $(CP) 14/junk.c $@}
vfprintf1.o: vfprintf.c
$(CC) -c -o $@ $(CFLAGS) -DSPLIT_FILE_1 $<
@ -47,8 +41,6 @@ vfprintf1.o: vfprintf.c
vfprintf2.o: junk.c
$(CC) -c -o $@ $(CFLAGS) -DSPLIT_FILE_2 $<
.INCLUDE: ../rules.mk
# Additional dependancies:
fclose.o:: local.h
fdopen.o:: local.h

View File

@ -1,22 +1,13 @@
#
# gno/lib/libc/stdlib/Makefile
#
# Devin Reade, 1997
#
# $Id: Makefile,v 1.4 1997/10/03 04:44:25 gdr Exp $
# $Id: Makefile,v 1.5 1998/02/09 08:44:55 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJS= cvt.o environ.o fpspecnum.o getopt.o getsubopt.o
OBJS = cvt.o environ.o fpspecnum.o getopt.o getsubopt.o
CFLAGS += -O78
build .PHONY: ../libc
obj: $(OBJS)
.INCLUDE: ../rules.mk
.INCLUDE: /src/gno/lib/lib.mk
fpspecnum.o:: fpspecnum.mac

View File

@ -1,23 +1,19 @@
#
# Makefile for libc/stdtime.
#
# $Id: Makefile,v 1.2 1997/10/03 04:44:25 gdr Exp $
# $Id: Makefile,v 1.3 1998/02/09 08:45:04 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
OBJS = asctime.o difftime.o localtime.o strftime.o
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJS= asctime.o difftime.o localtime.o strftime.o
CFLAGS += -v
default:
@echo do not use this directory yet
build .PHONY: ../libc
obj: $(OBJS)
.INCLUDE: ../rules.mk
.INCLUDE: /src/gno/lib/lib.mk
asctime.o:: private.h
difftime.o:: private.h

View File

@ -1,18 +1,11 @@
#
# gno/lib/libc/string/Makefile
#
# Devin Reade, 1997
#
# $Id: Makefile,v 1.4 1997/10/03 04:44:26 gdr Exp $
# $Id: Makefile,v 1.5 1998/02/09 08:45:13 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJS= case.o str.o strerror.o
OBJS = case.o str.o strerror.o
CFLAGS += -O78
build .PHONY: ../libc
obj: $(OBJS)
.INCLUDE: ../rules.mk
.INCLUDE: /src/gno/lib/lib.mk

View File

@ -1,20 +1,13 @@
#
# gno/lib/libc/sys/Makefile
#
# Devin Reade, 1997.
#
# $Id: Makefile,v 1.4 1997/10/03 04:44:26 gdr Exp $
# $Id: Makefile,v 1.5 1998/02/09 08:45:21 taubert Exp $
#
.INCLUDE: ../../../paths.mk
.INCLUDE: ../../const.mk
LIB= c
LIBPFX= $(OBJ_DIR)../
OBJS= exec.o syscall.o trap.o
OBJS = exec.o syscall.o trap.o
CFLAGS += -O78
build .PHONY: ../libc
obj: $(OBJS)
.INCLUDE: ../rules.mk
.INCLUDE: /src/gno/lib/lib.mk
trap.o:: trap.mac

View File

@ -7,15 +7,28 @@
#
# Devin Reade, 1997
#
# $Id: paths.mk,v 1.4 1998/01/26 00:44:20 gdr-ftp Exp $
# $Id: paths.mk,v 1.5 1998/02/09 08:43:47 taubert Exp $
#
# 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.
# I recommend using /src and defining it in /etc/namespace.
#
# OBJ_DIR can be used to store the resulting object and binary files on
# a separate partition from the source. This is very handy when the
# source is stored on an AppleShare volume. If you don't need this
# feature, you can either define /obj in /etc/namespace to be the same
# as /src, or simply comment out the OBJ_DIR line here.
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.

25
prog.mk
View File

@ -1,7 +1,7 @@
#
# prog.mk version 1.1.0 (August 31, 1997)
#
# $Id: prog.mk,v 1.4 1997/10/30 04:26:58 gdr Exp $
# $Id: prog.mk,v 1.5 1998/02/09 08:43:49 taubert Exp $
#
# This makefile is intended for use with dmake(1) and occ(1) on Apple IIGS
@ -37,16 +37,9 @@
# 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: /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
#
@ -57,14 +50,10 @@ OBJS=$(SRCS:s/.c/.o/:f)
.END
# Was special optimizing requested?
.IF $(OPTIMIZE) == $(NULL)
OPTIMIZE = 78
.END
OPTIMIZE*= 78
# Use stack size of 768 bytes if STACK macro isn't already defined
.IF $(STACK) == $(NULL)
STACK = 1024
.END
STACK *= 1024
# Compile and load flags passed to occ
# -r: don't create .root file (used on all but main file)
@ -72,12 +61,8 @@ CFLAGS += -r -O$(OPTIMIZE) $(DEFINES) -s$(STACK)
# If installation directories were not set, use defaults
.IF $(BINDIR) == $(NULL)
BINDIR = /bin
.END
.IF $(MANDIR) == $(NULL)
MANDIR = /usr/man
.END
BINDIR *= /bin
MANDIR *= /usr/man
RELBIN = $(RELEASE_DIR)$(BINDIR)
RELMAN = $(RELEASE_DIR)$(MANDIR)