mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
End of the make file simplifications.
This commit is contained in:
10
src/tutorial/C-code/Makefile
Normal file
10
src/tutorial/C-code/Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
SRCDIR= ../..
|
||||
LIBPQDIR= $(SRCDIR)/libpq
|
||||
include ../../Makefile.global
|
||||
|
||||
CFLAGS+= -I../../include -I$(LIBPQDIR)
|
||||
|
||||
all: complex$(SLSUFF) funcs$(SLSUFF)
|
||||
|
||||
clean:
|
||||
rm -f complex$(SLSUFF) funcs$(SLSUFF)
|
@ -1,39 +1,55 @@
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Makefile--
|
||||
# Makefile for tutorial/C-code
|
||||
#
|
||||
# Copyright (c) 1994, Regents of the University of California
|
||||
#
|
||||
# Makefile for tutorial
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.1.1.1 1996/07/09 06:22:33 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.2 1996/11/12 11:43:20 bryanh Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
MKDIR= ../mk
|
||||
include $(MKDIR)/postgres.mk
|
||||
SRCDIR= ..
|
||||
LIBPQDIR= $(SRCDIR)/libpq
|
||||
include ../Makefile.global
|
||||
|
||||
VPATH:= $(VPATH):C-code
|
||||
CFLAGS+= -I$(LIBPQDIR) -I../../include
|
||||
|
||||
LDADD+= -L$(LIBPQDIR) -lpq
|
||||
|
||||
#
|
||||
# build dynamically-loaded object files
|
||||
# DLOBJS is the dynamically-loaded object files. The "funcs" queries
|
||||
# include CREATE FUNCTIONs that load routines from these files.
|
||||
#
|
||||
DLOBJS= complex$(SLSUFF) funcs$(SLSUFF)
|
||||
DLOBJS= complex$(SLSUFF) funcs$(SLSUFF)
|
||||
|
||||
QUERIES= advanced.sql basics.sql complex.sql funcs.sql syscat.sql
|
||||
#
|
||||
# ... plus test query inputs
|
||||
# plus exports files
|
||||
#
|
||||
CREATEFILES= $(DLOBJS:%=$(objdir)/%) \
|
||||
advanced.sql basics.sql complex.sql funcs.sql syscat.sql
|
||||
ifdef EXPSUFF
|
||||
DLOBJS+= $(DLOBJS:.o=$(EXPSUFF))
|
||||
endif
|
||||
|
||||
include $(MKDIR)/postgres.user.mk
|
||||
all: $(QUERIES)
|
||||
|
||||
CFLAGS+= -I$(srcdir)/backend
|
||||
|
||||
CLEANFILES+= $(notdir $(CREATEFILES))
|
||||
|
||||
all:: $(CREATEFILES)
|
||||
%.sql: %.source
|
||||
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
|
||||
if [ -z "$$USER" ]; then USER=`whoami`; fi; \
|
||||
if [ -z "$$USER" ]; then echo 'Cannot deduce $$USER.'; exit 1; fi; \
|
||||
rm -f $@; \
|
||||
C=`pwd`; \
|
||||
sed -e "s:_CWD_:$$C:g" \
|
||||
-e "s:_OBJWD_:$$C:g" \
|
||||
-e "s:_SLSUFF_:$(SLSUFF):g" \
|
||||
-e "s/_USER_/$$USER/g" < $< > $@
|
||||
|
||||
funcs.sql:: $(DLOBJS)
|
||||
|
||||
$(DLOBJS):
|
||||
$(MAKE) -C C-code $@
|
||||
cp C-code/$@ .
|
||||
|
||||
clean:
|
||||
$(MAKE) -C C-code clean
|
||||
rm -f $(QUERIES)
|
||||
rm -f $(DLOBJS)
|
||||
|
Reference in New Issue
Block a user