diff --git a/configure b/configure index 8623f98b4f..88dc5cca67 100755 --- a/configure +++ b/configure @@ -9102,9 +9102,7 @@ ac_given_srcdir=$srcdir trap 'rm -fr `echo " GNUmakefile - src/GNUmakefile src/Makefile.global - src/backend/port/Makefile src/include/pg_config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF diff --git a/configure.in b/configure.in index f69658acfc..b9f41bb885 100644 --- a/configure.in +++ b/configure.in @@ -1247,9 +1247,7 @@ fi AC_OUTPUT( [ GNUmakefile - src/GNUmakefile src/Makefile.global - src/backend/port/Makefile ], [ # Update timestamp for pg_config.h (see Makefile.global) diff --git a/src/GNUmakefile.in b/src/GNUmakefile.in deleted file mode 100644 index 8909a6226c..0000000000 --- a/src/GNUmakefile.in +++ /dev/null @@ -1,43 +0,0 @@ -#------------------------------------------------------------------------- -# -# Makefile for src -# -# Copyright (c) 1994, Regents of the University of California -# -# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.61 2001/02/10 02:31:26 tgl Exp $ -# -#------------------------------------------------------------------------- - -subdir = src -top_builddir = .. -include Makefile.global - - -all install installdirs uninstall dep depend distprep: - $(MAKE) -C backend $@ - $(MAKE) -C include $@ - $(MAKE) -C interfaces $@ - $(MAKE) -C bin $@ - $(MAKE) -C pl $@ - -install-all-headers: - $(MAKE) -C include $@ - -clean: - $(MAKE) -C backend $@ - $(MAKE) -C include $@ - $(MAKE) -C interfaces $@ - $(MAKE) -C bin $@ - $(MAKE) -C pl $@ - $(MAKE) -C utils $@ - $(MAKE) -C test $@ - -distclean maintainer-clean: - -$(MAKE) -C utils $@ - -$(MAKE) -C backend $@ - -$(MAKE) -C include $@ - -$(MAKE) -C interfaces $@ - -$(MAKE) -C bin $@ - -$(MAKE) -C pl $@ - -$(MAKE) -C test $@ - rm -f Makefile.port Makefile.global GNUmakefile diff --git a/src/Makefile b/src/Makefile index 9de7cce180..f9312cd4b0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,36 +1,43 @@ -# The PostgreSQL make files exploit features of GNU make that other -# makes do not have. Because it is a common mistake for users to try -# to build Postgres with a different make, we have this make file -# that, as a service, will look for a GNU make and invoke it, or show -# an error message if none could be found. +#------------------------------------------------------------------------- +# +# Makefile for src +# +# Copyright (c) 1994, Regents of the University of California +# +# $Header: /cvsroot/pgsql/src/Makefile,v 1.24 2002/03/13 00:05:02 petere Exp $ +# +#------------------------------------------------------------------------- -# If the user were using GNU make now, this file would not get used -# because GNU make uses a make file named "GNUmakefile" in preference -# to "Makefile" if it exists. PostgreSQL is shipped with a -# "GNUmakefile". If the user hasn't run the configure script yet, the -# GNUmakefile won't exist yet, so we catch that case as well. +subdir = src +top_builddir = .. +include Makefile.global -all check install installdirs install-all-headers installcheck uninstall dep depend clean distclean maintainer-clean: - @if [ ! -f GNUmakefile ] ; then \ - echo "You need to run the 'configure' program first. See the file"; \ - echo "'INSTALL' for installation instructions." ; \ - false ; \ - fi - @IFS=':' ; \ - for dir in $$PATH; do \ - for prog in gmake gnumake make; do \ - if [ -f $$dir/$$prog ] && ( $$dir/$$prog -f /dev/null --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then \ - GMAKE=$$dir/$$prog; \ - break 2; \ - fi; \ - done; \ - done; \ - \ - if [ x"$${GMAKE+set}" = xset ]; then \ - echo "Using GNU make found at $${GMAKE}"; \ - $${GMAKE} $@ ; \ - else \ - echo "You must use GNU make to build PostgreSQL." ; \ - false; \ - fi +all install installdirs uninstall dep depend distprep: + $(MAKE) -C backend $@ + $(MAKE) -C include $@ + $(MAKE) -C interfaces $@ + $(MAKE) -C bin $@ + $(MAKE) -C pl $@ + +install-all-headers: + $(MAKE) -C include $@ + +clean: + $(MAKE) -C backend $@ + $(MAKE) -C include $@ + $(MAKE) -C interfaces $@ + $(MAKE) -C bin $@ + $(MAKE) -C pl $@ + $(MAKE) -C utils $@ + $(MAKE) -C test $@ + +distclean maintainer-clean: + -$(MAKE) -C utils $@ + -$(MAKE) -C backend $@ + -$(MAKE) -C include $@ + -$(MAKE) -C interfaces $@ + -$(MAKE) -C bin $@ + -$(MAKE) -C pl $@ + -$(MAKE) -C test $@ + rm -f Makefile.port Makefile.global diff --git a/src/Makefile.global.in b/src/Makefile.global.in index aad4c400d1..d2b89abe6d 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -1,5 +1,5 @@ # -*-makefile-*- -# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.142 2002/03/05 17:55:22 momjian Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.143 2002/03/13 00:05:02 petere Exp $ #------------------------------------------------------------------------------ # All PostgreSQL makefiles include this file and use the variables it sets, @@ -325,12 +325,21 @@ endif # # substitute implementations of the C library -INET_ATON = @INET_ATON@ -STRERROR = @STRERROR@ -SNPRINTF = @SNPRINTF@ -STRDUP = @STRDUP@ -MEMCMP = @MEMCMP@ -STRTOUL = @STRTOUL@ +GETHOSTNAME = @GETHOSTNAME@ +GETRUSAGE = @GETRUSAGE@ +INET_ATON = @INET_ATON@ +ISINF = @ISINF@ +MEMCMP = @MEMCMP@ +MISSING_RANDOM = @MISSING_RANDOM@ +SNPRINTF = @SNPRINTF@ +SRANDOM = @SRANDOM@ +STRCASECMP = @STRCASECMP@ +STRDUP = @STRDUP@ +STRERROR = @STRERROR@ +STRTOL = @STRTOL@ +STRTOUL = @STRTOUL@ + +TAS = @TAS@ ########################################################################## diff --git a/src/backend/Makefile b/src/backend/Makefile index 876d14a2dc..b12d828c7f 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.76 2002/02/18 06:03:22 momjian Exp $ +# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.77 2002/03/13 00:05:05 petere Exp $ # #------------------------------------------------------------------------- @@ -194,7 +194,7 @@ ifeq ($(enable_nls), yes) endif distclean: clean - rm -f port/Makefile port/tas.s port/dynloader.c + rm -f port/tas.s port/dynloader.c maintainer-clean: distclean rm -f $(srcdir)/bootstrap/bootparse.c \ diff --git a/src/backend/port/Makefile.in b/src/backend/port/Makefile similarity index 73% rename from src/backend/port/Makefile.in rename to src/backend/port/Makefile index 248dcd1fd3..93823b44cd 100644 --- a/src/backend/port/Makefile.in +++ b/src/backend/port/Makefile @@ -13,7 +13,7 @@ # be converted to Method 2. # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/port/Attic/Makefile.in,v 1.32 2002/03/04 17:43:32 tgl Exp $ +# $Header: /cvsroot/pgsql/src/backend/port/Makefile,v 1.11 2002/03/13 00:05:06 petere Exp $ # #------------------------------------------------------------------------- @@ -21,12 +21,14 @@ subdir = src/backend/port top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -# Note: invoking a macro from Makefile.global is better than substituting -# here; ideally this file should not need to be generated by configure -# at all. -OBJS = dynloader.o $(INET_ATON) $(STRERROR) @MISSING_RANDOM@ @SRANDOM@ -OBJS+= @GETHOSTNAME@ @GETRUSAGE@ $(MEMCMP) @STRCASECMP@ @TAS@ @ISINF@ -OBJS+= @STRTOL@ $(STRTOUL) $(SNPRINTF) +OBJS = dynloader.o + +OBJS += $(GETHOSTNAME) $(GETRUSAGE) $(INET_ATON) $(ISINF) $(MEMCMP) \ + $(MISSING_RANDOM) $(SNPRINTF) $(SRANDOM) $(STRCASECMP) $(STRERROR) \ + $(STRTOL) $(STRTOUL) $(SNPRINTF) + +OBJS += $(TAS) + ifdef STRDUP OBJS += $(top_builddir)/src/utils/strdup.o endif @@ -43,7 +45,7 @@ endif all: SUBSYS.o SUBSYS.o: $(OBJS) - $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) + $(LD) $(LDREL) $(LDOUT) $@ $^ $(top_builddir)/src/utils/strdup.o: $(MAKE) -C $(top_builddir)/src/utils strdup.o @@ -71,10 +73,3 @@ distclean clean: $(MAKE) -C beos clean $(MAKE) -C darwin clean $(MAKE) -C qnx4 clean - -depend dep: - $(CC) -MM $(CFLAGS) *.c >depend - -ifeq (depend,$(wildcard depend)) -include depend -endif