From 6bfb3527a992f63849cd93ab271220b95ffff3f9 Mon Sep 17 00:00:00 2001 From: gdr-ftp Date: Sun, 8 Feb 1998 03:47:40 +0000 Subject: [PATCH] - Makefiles now have common 'release' and 'install' targets - most Makefiles now use gno/lib/lib.mk (not all of libc has been done yet) --- lib/const.mk | 13 ++++++++++++- lib/lib.mk | 10 ++++++++-- lib/libc/Makefile | 18 ++++++++++++++---- lib/libc/libc.rez | 30 ++++++++++++++++++++++++++++++ lib/libcontrib/Makefile | 31 ++++++++++--------------------- lib/librelease.mk | 28 ++++++++++++++++++++++++++++ lib/libutil/Makefile | 31 ++++++++----------------------- lib/liby/Makefile | 30 ++++++++---------------------- 8 files changed, 118 insertions(+), 73 deletions(-) create mode 100755 lib/libc/libc.rez create mode 100755 lib/librelease.mk diff --git a/lib/const.mk b/lib/const.mk index bf42c31..4c70cfa 100644 --- a/lib/const.mk +++ b/lib/const.mk @@ -6,7 +6,7 @@ # # Devin Reade, 1997 # -# $Id: const.mk,v 1.4 1997/12/21 20:04:19 gdr Exp $ +# $Id: const.mk,v 1.5 1998/02/08 03:47:15 gdr-ftp Exp $ # # It is critical that 13/orcacdefs/defaults.h is set up correctly, # including #defines for __appleiigs__ and __GNO__. For the purpose @@ -22,6 +22,17 @@ LDFLAGS += INSTALL = /usr/bin/install CATREZ = /usr/bin/catrez +# Where libraries get installed. Most libraries should go into the +# USRLIBDIR; only "special" libraries belong in LIBDIR +LIBDIR = /lib +USRLIBDIR = /usr/lib +RELLIB = $(RELEASE_DIR)$(LIBDIR) +RELUSRLIB = $(RELEASE_DIR)$(USRLIBDIR) + # Byteworks' makelib pukes ... these object files are too much for it. 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) diff --git a/lib/lib.mk b/lib/lib.mk index 553c9ad..88d93a5 100644 --- a/lib/lib.mk +++ b/lib/lib.mk @@ -1,5 +1,5 @@ # -# $Id: lib.mk,v 1.1 1998/01/26 05:49:01 taubert Exp $ +# $Id: lib.mk,v 1.2 1998/02/08 03:47:17 gdr-ftp Exp $ # .INCLUDE: /src/gno/paths.mk @@ -25,6 +25,12 @@ OBJS= $(SRCS:s/.c/.o/:f) # Compile and load flags passed to occ CFLAGS+= -O$(OPTIMIZE) +# default target +build: $(LIBTARGET) + # Update library with out of date object files -lib$(LIB): $(OBJS) +$(LIBTARGET): $(OBJS) $(MAKELIB) $(MAKELIBFLAGS) -l $@ $^ + +.INCLUDE: /src/gno/lib/librelease.mk + diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 7608398..6e9683a 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -10,16 +10,26 @@ # # Devin Reade, 1997. # -# $Id: Makefile,v 1.6 1997/10/03 04:42:51 gdr Exp $ +# $Id: Makefile,v 1.7 1998/02/08 03:47:22 gdr-ftp Exp $ # +LIB = c + .INCLUDE: ../../paths.mk .INCLUDE: ../const.mk +USE_SLASH_LIB = true # This library goes into /lib. + ORCALIB_OBJ = \ $(ORCA_SRC)/orcalib/obj/assert.a -libc: - $(MAKELIB) $(MAKELIBFLAGS) -l $@ $(ORCALIB_OBJ) +libc: $(ORCALIB_OBJ) + $(MAKELIB) $(MAKELIBFLAGS) -l $@ $^ + +$(ORCALIB_OBJ):; true + +.INCLUDE: ../librelease.mk + +$(LIBTARGET):: lib$(LIB).r + $(CATREZ) -d $@ lib$(LIB).r -.PHONY: libc diff --git a/lib/libc/libc.rez b/lib/libc/libc.rez new file mode 100755 index 0000000..52cc984 --- /dev/null +++ b/lib/libc/libc.rez @@ -0,0 +1,30 @@ +/* + * Resources for version and comment + * + * $Id: libc.rez,v 1.1 1998/02/08 03:47:25 gdr-ftp Exp $ + */ + +#define LIB "libc for GNO" +#define PORTED "Ported from 4.4BSD and other sources by Devin Reade." + +#include "Types.rez" + +/* + * Version + */ +resource rVersion (1, purgeable3) { + { 2, 0, 6, /* Version 2.0.6 */ + beta, /* development|alpha|beta|final|release */ + 3 }, /* non-final release number */ + verUS, /* Country */ + LIB, + PORTED +}; + +/* + * Comment + */ +resource rComment (1, purgeable3) { + LIB "\n" + PORTED +}; diff --git a/lib/libcontrib/Makefile b/lib/libcontrib/Makefile index 8548cf4..87f9a52 100644 --- a/lib/libcontrib/Makefile +++ b/lib/libcontrib/Makefile @@ -1,28 +1,17 @@ # -# This is the top-level makefile for libcontrib, GNO v2.0.6 +# This is the makefile for libcontrib, GNO v2.0.6 # -# $Id: Makefile,v 1.2 1997/10/30 04:57:24 gdr Exp $ +# $Id: Makefile,v 1.3 1998/02/08 03:47:29 gdr-ftp Exp $ # -.INCLUDE: ../../paths.mk -.INCLUDE: ../const.mk +LIB = contrib +SRCS = copyfile.c expandpath.c strarray.c xalloc.c +OPTIMIZE = 78 +CFLAGS += -I. -Slibcontrib -LIB = libcontrib -OBJS = copyfile.o expandpath.o strarray.o xalloc.o -HEADER = contrib.h -LIBDIR = $(RELEASE_DIR)/usr/lib -INCDIR = $(RELEASE_DIR)/usr/include/gno +.INCLUDE: /src/gno/lib/lib.mk -CFLAGS += -I. -O78 -Slibcontrib +$(LIBTARGET):: lib$(LIB).r + $(CATREZ) -d $@ lib$(LIB).r -$(LIB): $(OBJS) $(LIB).r - $(RM) -f $@ - $(MAKELIB) $(MAKELIBFLAGS) -l $@ $(OBJS) - $(CATREZ) -d $(LIB) $(LIB).r - -release: $(LIB) $(HEADER) - $(INSTALL) -d $(LIBDIR) $(INCDIR) - $(INSTALL) $(LIB) $(LIBDIR) - $(INSTALL) $(HEADER) $(INCDIR) - -$(OBJS):: $(HEADER) +$(OBJS):: contrib.h diff --git a/lib/librelease.mk b/lib/librelease.mk new file mode 100755 index 0000000..63411e6 --- /dev/null +++ b/lib/librelease.mk @@ -0,0 +1,28 @@ +# +# Default 'release' and 'install' rules. These are intended for +# use when building libraries. +# +# $Id: librelease.mk,v 1.1 1998/02/08 03:47:18 gdr-ftp Exp $ +# +# Devin Reade, February 1998. +# + +# Select the appropriate destination directory. +.IF $(USE_SLASH_LIB) != $(NULL) + TARGET_DIR = $(LIBDIR) + RELTARGET_DIR = $(RELLIB) +.ELSE + TARGET_DIR = $(USRLIBDIR) + RELTARGET_DIR = $(RELUSRLIB) +.END + +# Place files where they will subsequently be archived in a binary +# distribution. +release: $(LIBTARGET) + $(INSTALL) -d $(RELTARGET_DIR) + $(INSTALL) $(LIBTARGET) $(RELTARGET_DIR) + +# Install files into a live system. +install: $(LIBTARGET) + $(INSTALL) -d $(TARGET_DIR) + $(INSTALL) $(LIBTARGET) $(TARGET_DIR) diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 645f8b3..9ea5286 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -1,29 +1,14 @@ # -# This is the top-level makefile for libutil, GNO v2.0.6 +# This is the makefile for libutil, GNO v2.0.6 # -# $Id: Makefile,v 1.3 1997/10/03 04:47:34 gdr Exp $ +# $Id: Makefile,v 1.4 1998/02/08 03:47:34 gdr-ftp Exp $ # -.INCLUDE: ../../paths.mk -.INCLUDE: ../const.mk +LIB = util +SRCS = login.o logintty.o logwtmp.o +OPTIMIZE = 78 -LIB = libutil -OBJS = login.o logintty.o logwtmp.o -LIBDIR = /usr/lib +.INCLUDE: /src/gno/lib/lib.mk -CFLAGS += -O78 - -build: $(LIB) - -$(LIB): $(OBJS) libutil.r - $(RM) -f $@ - $(MAKELIB) $(MAKELIBFLAGS) -l $@ $(OBJS) - $(CATREZ) -d $@ libutil.r - -install: $(LIB) - $(INSTALL) -d $(LIBDIR) - $(INSTALL) $(LIB) $(LIBDIR) - -release: $(LIB) - $(INSTALL) -d $(RELEASE_DIR)$(LIBDIR) - $(INSTALL) $(LIB) $(RELEASE_DIR)$(LIBDIR) +$(LIBTARGET):: lib$(LIB).r + $(CATREZ) -d $@ lib$(LIB).r diff --git a/lib/liby/Makefile b/lib/liby/Makefile index b4aed14..f801d44 100644 --- a/lib/liby/Makefile +++ b/lib/liby/Makefile @@ -1,29 +1,15 @@ # -# This is the top-level makefile for libutil, GNO v2.0.6 +# This is the makefile for liby, GNO v2.0.6 # -# $Id: Makefile,v 1.2 1997/10/03 04:46:02 gdr Exp $ +# $Id: Makefile,v 1.3 1998/02/08 03:47:40 gdr-ftp Exp $ # -.INCLUDE: ../../paths.mk -.INCLUDE: ../const.mk +LIB = y +SRCS = main.c yyerror.c +OPTIMIZE = 78 -LIB = liby -OBJS = main.o yyerror.o -LIBDIR = /usr/lib +.INCLUDE: /src/gno/lib/lib.mk -CFLAGS += -O78 +$(LIBTARGET):: lib$(LIB).r + $(CATREZ) -d $@ lib$(LIB).r -build: $(LIB) - -$(LIB): $(OBJS) liby.r - $(RM) -f $@ - $(MAKELIB) $(MAKELIBFLAGS) -l $@ $(OBJS) - $(CATREZ) -d $@ liby.r - -install: $(LIB) - $(INSTALL) -d $(LIBDIR) - $(INSTALL) $(LIB) $(LIBDIR) - -release: $(LIB) - $(INSTALL) -d $(RELEASE_DIR)$(LIBDIR) - $(INSTALL) $(LIB) $(RELEASE_DIR)$(LIBDIR)