1996-07-09 08:22:35 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile--
|
1996-11-12 12:43:32 +01:00
|
|
|
# Makefile for tutorial
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
# IDENTIFICATION
|
1996-11-13 11:36:36 +01:00
|
|
|
# $Header: /cvsroot/pgsql/src/tutorial/Makefile,v 1.3 1996/11/13 10:36:24 bryanh Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
SRCDIR= ..
|
|
|
|
include ../Makefile.global
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
CFLAGS+= -I$(LIBPQDIR) -I../../include
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
LDADD+= -L$(LIBPQDIR) -lpq
|
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
1996-11-12 12:43:32 +01:00
|
|
|
# DLOBJS is the dynamically-loaded object files. The "funcs" queries
|
|
|
|
# include CREATE FUNCTIONs that load routines from these files.
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
1996-11-12 12:43:32 +01:00
|
|
|
DLOBJS= complex$(SLSUFF) funcs$(SLSUFF)
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
QUERIES= advanced.sql basics.sql complex.sql funcs.sql syscat.sql
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
1996-11-12 12:43:32 +01:00
|
|
|
# plus exports files
|
1996-07-09 08:22:35 +02:00
|
|
|
#
|
1996-11-12 12:43:32 +01:00
|
|
|
ifdef EXPSUFF
|
|
|
|
DLOBJS+= $(DLOBJS:.o=$(EXPSUFF))
|
|
|
|
endif
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
all: $(QUERIES)
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
%.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" < $< > $@
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
funcs.sql:: $(DLOBJS)
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
$(DLOBJS):
|
|
|
|
$(MAKE) -C C-code $@
|
|
|
|
cp C-code/$@ .
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1996-11-12 12:43:32 +01:00
|
|
|
clean:
|
|
|
|
$(MAKE) -C C-code clean
|
|
|
|
rm -f $(QUERIES)
|
|
|
|
rm -f $(DLOBJS)
|