diff options
author | Marc G. Fournier <scrappy@hub.org> | 1996-07-09 06:22:35 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1996-07-09 06:22:35 +0000 |
commit | d31084e9d1118b25fd16580d9d8c2924b5740dff (patch) | |
tree | 3179e66307d54df9c7b966543550e601eb55e668 /src/mk/postgres.mk | |
download | postgresql-PG95-1_01.tar.gz postgresql-PG95-1_01.zip |
Postgres95 1.01 Distribution - Virgin SourcesPG95-1_01
Diffstat (limited to 'src/mk/postgres.mk')
-rw-r--r-- | src/mk/postgres.mk | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/src/mk/postgres.mk b/src/mk/postgres.mk new file mode 100644 index 00000000000..83e34a8ad37 --- /dev/null +++ b/src/mk/postgres.mk @@ -0,0 +1,150 @@ +#------------------------------------------------------------------------- +# +# postgres.mk-- +# The master postgres makefile for implicit rules, definitions and +# variables. Every postgres makefile (except those that include +# postgres.subdir.mk only) should include this file. +# +# Copyright (c) 1994-5, Regents of the University of California +# +# +# IDENTIFICATION +# $Header: /cvsroot/pgsql/src/mk/Attic/postgres.mk,v 1.1.1.1 1996/07/09 06:22:19 scrappy Exp $ +# +#------------------------------------------------------------------------- + + +############################################################################## +# +# Default first rule (all): +# This is here so that people doing "gmake" without arguments will +# build the program (PROG), shell script (SHPROG) or library (LIB). To +# override this, you could define a rule before including postgres.mk. +# (See .dosomething: for an explanation of its presence.) +# + +ifdef PROG +all: localobj $(PROG) .dosomething +else +ifdef SHPROG +all: localobj $(SHPROG) .dosomething +else +ifdef LIB +#all: localobj lib$(LIB).a install-headers .dosomething +all: localobj lib$(LIB).a +else +# if you don't define PROG, SHPROG or LIB before including this, use :: for +# your all. (this is here so that clean is not the first rule) +all:: localobj +endif +endif +endif + +############################################################################## +# +# Flags for programs (ar, yacc, etc.) +# + +YFLAGS= -d +RANLIB= touch +AROPT= crs +#AROPT= cq +LINTFLAGS = + + +# +# Installation. +# +# This is the default for all platforms. If your platform uses a different +# BSD-style install program, change it in src/mk/port/postgres.mk.$PORTNAME +INSTALL= installbsd + +INSTLOPTS= -c -m 444 +INSTL_EXE_OPTS= -c -m 555 +INSTL_LIB_OPTS= -c -m 664 + +############################################################################## +# +# Canned command sequences +# + +# making partial objects (if BIGOBJS is defined) +define make_partial + $(LD) -r -o $(objdir)/$(@F) $(addprefix $(objdir)/,$(notdir $^)) +endef + +# compiling a .c which is generated (and is in $objdir) +define cc_inobjdir + $(CC) -c $(CFLAGS) $(CPPFLAGS) $(objdir)/$(<F) -o $(objdir)/$(@F) +endef + + +############################################################################## +# +# Variables +# + +# Makefile.global is where the user configurations are. (objdir is defined +# there) +include $(MKDIR)/../Makefile.global +-include $(MKDIR)/port/postgres.mk.$(PORTNAME) + +CURDIR:= $(shell pwd) + +# This is where we put all the .o's and the generated files. +VPATH:= $(CURDIR)/$(objdir) + + +############################################################################## +# +# General rules +# + +.PHONY: clean .dosomething localobj beforeinstall + +# clean up the objects and generated files +clean: + cd $(objdir); rm -f $(CLEANFILES) + +# just a matter of personal taste; make sure we do something and don't +# get this message: "gmake[1]: Nothing to be done for 'all'." +.dosomething: + @cat /dev/null + +localobj: + @if test ! -d $(objdir); then mkdir $(objdir); else true; fi; + +# +# create the directories before doing install +# +ifndef NO_BEFOREINSTL +beforeinstall: localobj + @-if test ! -d $(DESTDIR)$(LIBDIR); \ + then mkdir $(DESTDIR)$(LIBDIR); fi + @-if test ! -d $(DESTDIR)$(BINDIR); \ + then mkdir $(DESTDIR)$(BINDIR); fi + @-if test ! -d $(DESTDIR)$(DATADIR); \ + then mkdir $(DESTDIR)$(DATADIR); fi + @-if test ! -d $(DESTDIR)$(DATADIR)/files; \ + then mkdir $(DESTDIR)$(DATADIR)/files; fi +else +beforeinstall: localobj +endif + +############################################################################## +# +# Implicit rules +# + +# building .o from C++ sources +$(objdir)/%.o: %.cc + $(CXX) $(CXXFLAGS) -c $< -o $@ + +# building .o from .c (in $objdir): +$(objdir)/%.o: %.c + $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $(objdir)/$(@F) + +# building .o from .s (in $objdir): +$(objdir)/%.o: %.s + $(AS) $(ASFLAGS) $< -o $(objdir)/$(@F) + |