From fc332dde3dc117673b9e82bd79d09157501e3769 Mon Sep 17 00:00:00 2001 From: niklas Date: Tue, 26 Mar 1996 00:27:38 +0000 Subject: [PATCH] Make "make obj" work, make builds to obj directories work. Don't put object files in SRCS variables, add them to OBJS instead. Also explicitly mention -lg++ because g++ won't use the -L path for getting libg++ unless done via the command line. --- gnu/lib/libg++/libg++/Makefile.bsd-wrapper | 41 +++++++++++++++---- .../libg++/libg++/gperf/Makefile.bsd-wrapper | 31 +++++++++++--- gnu/lib/libg++/libstdc++/Makefile.bsd-wrapper | 39 +++++++++++++++--- 3 files changed, 92 insertions(+), 19 deletions(-) diff --git a/gnu/lib/libg++/libg++/Makefile.bsd-wrapper b/gnu/lib/libg++/libg++/Makefile.bsd-wrapper index d7119bea3be..6e356a4943d 100644 --- a/gnu/lib/libg++/libg++/Makefile.bsd-wrapper +++ b/gnu/lib/libg++/libg++/Makefile.bsd-wrapper @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.1 1996/03/16 05:18:44 etheisen Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.2 1996/03/26 00:27:38 niklas Exp $ VERSION = 2.7.1 LIBG++_DIST_VERSION = 2.7.1 @@ -28,12 +28,35 @@ CSRCS= bitand.c bitany.c bitblt.c bitclear.c bitcopy.c bitcount.c \ COBJS= $(CSRCS:N*.h:R:S/$/.o/g) GXXOBJS= $(CXXOBJS) $(COBJS) -RX_DIR= ../librx -RXOBJ= $(RX_DIR)/rx.o -LIBIO_DIR= ../libio -G_CFG_H= $(LIBIO)/_G_config.h +.if defined(OBJMACHINE) +OBJDIR= obj.${MACHINE} +.else +OBJDIR= obj +.endif -SRCS= $(CXXSRCS) $(CSRCS) $(RXOBJ) +RX_DIR= $(.CURDIR)/../librx + +RX_OBJDIR!= if [ -d $(RX_DIR)/$(OBJDIR) ]; then \ + echo $(RX_DIR)/$(OBJDIR); \ + else \ + echo $(RX_DIR); \ + fi + +RXOBJ= $(RX_OBJDIR)/rx.o + +LIBIO_DIR= $(.CURDIR)/../libio + +LIBIO_OBJDIR!= if [ -d $(LIBIO_DIR)/$(OBJDIR) ]; then \ + echo $(LIBIO_DIR)/$(OBJDIR); \ + else \ + echo $(LIBIO_DIR); \ + fi + +G_CFG_H= $(LIBIO_OBJDIR)/_G_config.h + +SRCS= $(CXXSRCS) $(CSRCS) + +OBJS= $(RXOBJ) CLEANFILES+= rx.h @@ -42,13 +65,13 @@ all: rx.h $(G_CFG_H) beforedepend: rx.h $(G_CFG_H) rx.h: - ln -s $(.CURDIR)/../librx/rx.h + ln -s $(RX_DIR)/rx.h $(G_CFG_H): - @cd $(.CURDIR)/../libio; $(MAKE) -f Makefile.bsd-wrapper _G_config.h + @cd $(LIBIO_DIR); $(MAKE) -f Makefile.bsd-wrapper _G_config.h $(RXOBJ) $(RXOBJ:.o=.po) $(RXOBJ:.o=.so): - cd $(.CURDIR)/../$(RX_DIR); $(MAKE) -f Makefile.bsd-wrapper + cd $(RX_DIR); $(MAKE) -f Makefile.bsd-wrapper clean: _SUBDIRUSE rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES} diff --git a/gnu/lib/libg++/libg++/gperf/Makefile.bsd-wrapper b/gnu/lib/libg++/libg++/gperf/Makefile.bsd-wrapper index 4a536e26b2f..6f004ebbdeb 100644 --- a/gnu/lib/libg++/libg++/gperf/Makefile.bsd-wrapper +++ b/gnu/lib/libg++/libg++/gperf/Makefile.bsd-wrapper @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.1 1996/03/16 05:18:48 etheisen Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.2 1996/03/26 00:28:07 niklas Exp $ .PATH: $(.CURDIR)/src @@ -10,17 +10,38 @@ CPPFLAGS+= -nostdinc++ -I$(.CURDIR)/src -I$(.CURDIR)/../../libio \ SRCS= new.cc options.cc iterator.cc main.cc gen-perf.cc \ key-list.cc list-node.cc hash-table.cc bool-array.cc \ read-line.cc std-err.cc version.cc -LDFLAGS+= -L../../libstdc++ -L.. + +.if defined(OBJMACHINE) +OBJDIR= obj.${MACHINE} +.else +OBJDIR= obj +.endif STD_DIR= ../../libstdc++ + +STD_OBJDIR!= if [ -d $(STD_DIR)/$(OBJDIR) ]; then \ + echo $(STD_DIR)/$(OBJDIR); \ + else \ + echo $(STD_DIR); \ + fi + GXX_DIR= .. -all: $(STD_DIR)/libstdc++.a $(GXX_DIR)/libg++.a +GXX_OBJDIR!= if [ -d $(GXX_DIR)/$(OBJDIR) ]; then \ + echo $(GXX_DIR)/$(OBJDIR); \ + else \ + echo $(GXX_DIR); \ + fi + +LDFLAGS+= -L$(STD_OBJDIR) -L$(GXX_OBJDIR) +LDADD+= -lg++ + +all: $(STD_OBJDIR)/libstdc++.a $(GXX_OBJDIR)/libg++.a -$(STD_DIR)/libstdc++.a: +$(STD_OBJDIR)/libstdc++.a: cd $(STD_DIR); $(MAKE) -f Makefile.bsd-wrapper -$(GXX_DIR)/libg++.a: +$(GXX_OBJDIR)/libg++.a: cd $(GXX_DIR); $(MAKE) -f Makefile.bsd-wrapper install: maninstall diff --git a/gnu/lib/libg++/libstdc++/Makefile.bsd-wrapper b/gnu/lib/libg++/libstdc++/Makefile.bsd-wrapper index 72764b5f88e..531f9282340 100644 --- a/gnu/lib/libg++/libstdc++/Makefile.bsd-wrapper +++ b/gnu/lib/libg++/libstdc++/Makefile.bsd-wrapper @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.1 1996/03/16 05:18:55 etheisen Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.2 1996/03/26 00:29:27 niklas Exp $ LIB= stdc++ CXXFLAGS+= -fno-implicit-templates -nostdinc++ @@ -19,17 +19,46 @@ LIBIBERTY_DIR= ../libiberty STL_DIR= ./stl STD_DIR= ./std -IO_OBJS!= cat $(IO_DIR)/iostream.list +.if defined(OBJMACHINE) +OBJDIR= obj.${MACHINE} +.else +OBJDIR= obj +.endif + +IO_OBJDIR!= if [ -d $(IO_DIR)/$(OBJDIR) ]; then \ + echo $(IO_DIR)/$(OBJDIR); \ + else \ + echo $(IO_DIR); \ + fi + +IO_OBJS!= if [ -f $(IO_OBJDIR)/iostream.list ]; then \ + cat $(IO_OBJDIR)/iostream.list; \ + else \ + echo ' '; \ + fi + QIO_OBJS= $(IO_OBJS:S/^/$(IO_DIR)\//g) -LIBIBERTY_OBJS!=cat $(LIBIBERTY_DIR)/needed-list +LIBIBERTY_OBJDIR!=if [ -d $(LIBIBERTY_DIR)/$(OBJDIR) ]; then \ + echo $(LIBIBERTY_DIR)/$(OBJDIR); \ + else \ + echo $(LIBIBERTY_DIR); \ + fi + +LIBIBERTY_OBJS!=if [ -f $(LIBIBERTY_OBJDIR)/needed-list ]; then \ + cat $(LIBIBERTY_OBJDIR)/needed-list; \ + else \ + echo ' '; \ + fi + LIBIBERTY_OBJS+=strerror.o QLIBIBERTY_OBJS=$(LIBIBERTY_OBJS:S/^/$(LIBIBERTY_DIR)\//g) STL_OBJS= $(STL_DIR)/tempbuf.o $(STL_DIR)/tree.o $(STL_DIR)/random.o -SRCS= $(STD_SRCS) $(SPEC_OBJS) $(QIO_OBJS) $(QLIBIBERTY_OBJS) \ - $(STL_OBJS) +SRCS= $(STD_SRCS) + +OBJS= $(SPEC_OBJS) $(QIO_OBJS) $(QLIBIBERTY_OBJS) $(STL_OBJS) HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath \ complex csetjmp csignal cstdarg cstddef cstdio cstdlib \ -- 2.20.1