# Makefile for utils/misc
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.16 2000/06/04 01:44:34 petere Exp $
+# src/backend/utils/misc/Makefile
#
#-------------------------------------------------------------------------
-SRCDIR = ../../..
-include $(SRCDIR)/Makefile.global
+subdir = src/backend/utils/misc
+top_builddir = ../../../..
+include $(top_builddir)/src/Makefile.global
-OBJS = database.o superuser.o guc.o guc-file.o ps_status.o
+override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
-all: SUBSYS.o
+OBJS = guc.o help_config.o pg_rusage.o ps_status.o rbtree.o \
+ superuser.o timeout.o tzparser.o
-SUBSYS.o: $(OBJS)
- $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
+# This location might depend on the installation directories. Therefore
+# we can't subsitute it into pg_config.h.
+ifdef krb_srvtab
+override CPPFLAGS += -DPG_KRB_SRVTAB='"$(krb_srvtab)"'
+endif
-guc-file.c: guc-file.l
- $(LEX) $(LFLAGS) $<
- sed -e 's/lex\.yy\.c/guc-file\.c/g' \
- -e 's/^yy/GUC_yy/g' \
- -e 's/\([^a-zA-Z0-9_]\)yy/\1GUC_yy/g' < lex.yy.c > $@
- rm -f lex.yy.c
+include $(top_srcdir)/src/backend/common.mk
+
+# guc-file is compiled as part of guc
+guc.o: guc-file.c
+guc-file.c: guc-file.l
+ifdef FLEX
+ $(FLEX) $(FLEXFLAGS) -o'$@' $<
+else
+ @$(missing) flex $< $@
+endif
# Note: guc-file.c is not deleted by 'make clean',
# since we want to ship it in distribution tarballs.
-
-clean:
- rm -f SUBSYS.o $(OBJS) lex.yy.c
-
-depend dep:
- $(CC) -MM $(CFLAGS) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif
+clean:
+ @rm -f lex.yy.c