1 #-------------------------------------------------------------------------
3 # Makefile for src/bin/pg_config
5 # Copyright (c) 1998-2007, PostgreSQL Global Development Group
7 # $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.18 2007/01/05 22:19:48 momjian Exp $
9 #-------------------------------------------------------------------------
11 PGFILEDESC = "pg_config - report configuration information"
12 subdir = src/bin/pg_config
13 top_builddir = ../../..
14 include $(top_builddir)/src/Makefile.global
16 OBJS= pg_config.o $(WIN32RES)
18 # don't include subdirectory-path-dependent -I and -L switches
19 STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
20 STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/port,$(LDFLAGS))
22 override CPPFLAGS += -DFRONTEND
23 override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
24 override CPPFLAGS += -DVAL_CC="\"$(CC)\""
25 override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
26 override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
27 override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
28 override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
29 override CPPFLAGS += -DVAL_LDFLAGS_SL="\"$(LDFLAGS_SL)\""
30 override CPPFLAGS += -DVAL_LIBS="\"$(LIBS)\""
32 all: submake-libpgport pg_config
35 $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
37 install: all installdirs
38 $(INSTALL_SCRIPT) pg_config$(X) '$(DESTDIR)$(bindir)/pg_config$(X)'
41 $(mkinstalldirs) '$(DESTDIR)$(bindir)'
44 rm -f '$(DESTDIR)$(bindir)/pg_config$(X)'
46 clean distclean maintainer-clean:
47 rm -f pg_config$(X) $(OBJS)