From: niklas Date: Wed, 27 Mar 1996 23:00:01 +0000 (+0000) Subject: Misc. cleanup, esp. for obj-dirs, DESTDIR compilations and missing X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=503c991c6d3e1c653a2145de4028ebed856debf6;p=openbsd Misc. cleanup, esp. for obj-dirs, DESTDIR compilations and missing dependencies. --- diff --git a/gnu/lib/libg++/libg++/gperf/Makefile.bsd-wrapper b/gnu/lib/libg++/libg++/gperf/Makefile.bsd-wrapper index 6f004ebbdeb..6fdc5cc1cac 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.2 1996/03/26 00:28:07 niklas Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.3 1996/03/27 23:00:01 niklas Exp $ .PATH: $(.CURDIR)/src @@ -17,7 +17,7 @@ OBJDIR= obj.${MACHINE} OBJDIR= obj .endif -STD_DIR= ../../libstdc++ +STD_DIR= $(.CURDIR)/../../libstdc++ STD_OBJDIR!= if [ -d $(STD_DIR)/$(OBJDIR) ]; then \ echo $(STD_DIR)/$(OBJDIR); \ @@ -25,7 +25,7 @@ STD_OBJDIR!= if [ -d $(STD_DIR)/$(OBJDIR) ]; then \ echo $(STD_DIR); \ fi -GXX_DIR= .. +GXX_DIR= $(.CURDIR)/.. GXX_OBJDIR!= if [ -d $(GXX_DIR)/$(OBJDIR) ]; then \ echo $(GXX_DIR)/$(OBJDIR); \ @@ -34,7 +34,10 @@ GXX_OBJDIR!= if [ -d $(GXX_DIR)/$(OBJDIR) ]; then \ fi LDFLAGS+= -L$(STD_OBJDIR) -L$(GXX_OBJDIR) -LDADD+= -lg++ + +# if DESTDIR is set, then -nostdlib will be fed to g++, which will prevent +# -lg++ to be automatically included. So add it here, no matter what. +LDADD+= -lg++ -lstdc++ all: $(STD_OBJDIR)/libstdc++.a $(GXX_OBJDIR)/libg++.a diff --git a/gnu/lib/libg++/libiberty/Makefile.bsd-wrapper b/gnu/lib/libg++/libiberty/Makefile.bsd-wrapper index 980cb369c15..effdc51f782 100644 --- a/gnu/lib/libg++/libiberty/Makefile.bsd-wrapper +++ b/gnu/lib/libg++/libiberty/Makefile.bsd-wrapper @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.1 1996/03/16 05:18:49 etheisen Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.2 1996/03/27 23:00:03 niklas Exp $ LIB= iberty CPPFLAGS+= -I$(.CURDIR) -I$(.CURDIR)/../include -I$(.OBJDIR) @@ -63,7 +63,7 @@ needed2.awk: functions.def @grep '^DEFFUNC(' < $(.CURDIR)/functions.def \ | sed -e '/DEFFUNC/s|DEFFUNC.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' >>needed2.awk -dummy.o: dummy.c functions.def +dummy.o: dummy.c alloca-conf.h functions.def @echo Generating $(.TARGET) @$(CC) -c $(CFLAGS) $(CPPFLAGS) $(.IMPSRC) 2>/dev/null diff --git a/gnu/lib/libg++/libio/Makefile.bsd-wrapper b/gnu/lib/libg++/libio/Makefile.bsd-wrapper index 719fee09a74..419d87dfa7a 100644 --- a/gnu/lib/libg++/libio/Makefile.bsd-wrapper +++ b/gnu/lib/libg++/libio/Makefile.bsd-wrapper @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.1 1996/03/16 05:18:51 etheisen Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.2 1996/03/27 23:00:04 niklas Exp $ LIBIO= io LIBIOSTREAM= iostream @@ -67,7 +67,7 @@ clean: rm -f llib-lib$(LIBIOSTREAM).ln $(IOSTREAM_SRCS:.cc=.ln) install: _G_config.h - install -d -m 755 -o $(BINOWN) -g $(BINGRP) /usr/include/g++ + install -d -m 755 -o $(BINOWN) -g $(BINGRP) $(DESTDIR)/usr/include/g++ @-cd $(.CURDIR); for i in $(FILES); do \ cmp -s $$i $(DESTDIR)/usr/include/g++/$$i || \ install -c -o $(BINOWN) -g $(BINGRP) -m $(NONBINMODE) \ diff --git a/gnu/lib/libg++/libstdc++/Makefile.bsd-wrapper b/gnu/lib/libg++/libstdc++/Makefile.bsd-wrapper index 531f9282340..be5240adbfb 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.2 1996/03/26 00:29:27 niklas Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.3 1996/03/27 23:00:05 niklas Exp $ LIB= stdc++ CXXFLAGS+= -fno-implicit-templates -nostdinc++ @@ -14,10 +14,10 @@ SPEC_OBJS= cstrmain.o cstrio.o fcomplex.o fcomio.o dcomplex.o dcomio.o \ ldcomplex.o ldcomio.o STD_OBJS= $(STD_SRCS:N*.h:R:S/$/.o/g) $(SPEC_OBJS) -IO_DIR= ../libio -LIBIBERTY_DIR= ../libiberty -STL_DIR= ./stl -STD_DIR= ./std +IO_DIR= $(.CURDIR)/../libio +LIBIBERTY_DIR= $(.CURDIR)/../libiberty +STL_DIR= $(.CURDIR)/stl +STD_DIR= $(.CURDIR)/std .if defined(OBJMACHINE) OBJDIR= obj.${MACHINE} @@ -31,30 +31,41 @@ IO_OBJDIR!= if [ -d $(IO_DIR)/$(OBJDIR) ]; then \ 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_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 +# As we need to fill variables with contents of dynamically created files +# we must first see to that they are really generated. This is a hack that +# ensures this. The echo at the end is because make doesn't like command +# substitutions to not generate output. +PREREQ!= test ! -f $(IO_OBJDIR)/iostream.list && \ + (cd $(IO_DIR); \ + make -f Makefile.bsd-wrapper iostream.list); \ + test ! -f $(LIBIBERTY_OBJDIR)/needed-list && \ + (cd $(LIBIBERTY_DIR); \ + make -f Makefile.bsd-wrapper needed-list); \ + echo 'Prerequistes made' + + +IO_OBJS!= cat $(IO_OBJDIR)/iostream.list +QIO_OBJS= $(IO_OBJS:S/^/$(IO_OBJDIR)\//g) +LIBIBERTY_OBJS!=cat $(LIBIBERTY_OBJDIR)/needed-list +# XXX why does strerror.o need to be hardwired? LIBIBERTY_OBJS+=strerror.o -QLIBIBERTY_OBJS=$(LIBIBERTY_OBJS:S/^/$(LIBIBERTY_DIR)\//g) +QLIBIBERTY_OBJS=$(LIBIBERTY_OBJS:S/^/$(LIBIBERTY_OBJDIR)\//g) -STL_OBJS= $(STL_DIR)/tempbuf.o $(STL_DIR)/tree.o $(STL_DIR)/random.o +STL_OBJDIR!= if [ -d $(STL_DIR)/$(OBJDIR) ]; then \ + echo $(STL_DIR)/$(OBJDIR); \ + else \ + echo $(STL_DIR); \ + fi + +STL_OBJS= $(STL_OBJDIR)/tempbuf.o $(STL_OBJDIR)/tree.o \ + $(STL_OBJDIR)/random.o SRCS= $(STD_SRCS) @@ -66,6 +77,15 @@ HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath \ stdexcept typeinfo algorithm deque list map queue set stack \ vector utility functional iterator memory numeric +G_CFG_H= $(IO_OBJDIR)/_G_config.h + +all: $(G_CFG_H) + +beforedepend: $(G_CFG_H) + +$(G_CFG_H): + cd $(IO_DIR); make -f Makefile.bsd-wrapper _G_config.h + clean: _SUBDIRUSE rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES} rm -f lib${LIB}.a ${STD_OBJS} @@ -74,7 +94,8 @@ clean: _SUBDIRUSE rm -f llib-l${LIB}.ln ${STD_OBJS:.o=.ln} afterinstall: - install -d -m 755 -o $(BINOWN) -g $(BINGRP) /usr/include/g++/std + install -d -m 755 -o $(BINOWN) -g $(BINGRP) \ + $(DESTDIR)/usr/include/g++/std @-cd $(.CURDIR); for i in $(HEADERS) *.h std/*.*; do \ cmp -s $$i $(DESTDIR)/usr/include/g++/$$i || \ install -c -o $(BINOWN) -g $(BINGRP) -m $(NONBINMODE) \ @@ -84,13 +105,13 @@ afterinstall: # Misc GNU overidden targets. # $(STL_OBJS) $(STL_OBJS:.o=.po) $(STL_OBJS:.o=.so): - cd $(.CURDIR)/$(STL_DIR); $(MAKE) -f Makefile.bsd-wrapper + cd $(STL_DIR); $(MAKE) -f Makefile.bsd-wrapper $(QIO_OBJS) $(QIO_OBJS:.o=.po) $(QIO_OBJS:.o=.so): - cd $(.CURDIR)/$(IO_DIR); $(MAKE) -f Makefile.bsd-wrapper + cd $(IO_DIR); $(MAKE) -f Makefile.bsd-wrapper $(QLIBIBERTY_OBJS) $(QLIBIBERTY_OBJS:.o=.po) $(QLIBIBERTY_OBJS:.o=.so): - cd $(.CURDIR)/$(LIBIBERTY_DIR); $(MAKE) -f Makefile.bsd-wrapper + cd $(LIBIBERTY_DIR); $(MAKE) -f Makefile.bsd-wrapper stdexcepti.o: stdexcepti.cc $(.CURDIR)/std/stdexcept.h @echo "${COMPILE.cc} -frtti ${.IMPSRC}"