~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/port/Makefile

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#-------------------------------------------------------------------------
 
2
#
 
3
# Makefile
 
4
#    Makefile for the port-specific subsystem of the backend
 
5
#
 
6
# These files are used in other directories for portability on systems
 
7
# with broken/missing library files, and for common code sharing.
 
8
#
 
9
# This makefile generates two outputs:
 
10
#
 
11
#       libpgport.a - contains object files with FRONTEND defined,
 
12
#               for use by client application and libraries
 
13
#
 
14
#       libpgport_srv.a - contains object files without FRONTEND defined,
 
15
#               for use only by the backend binaries
 
16
#
 
17
# IDENTIFICATION
 
18
#    $PostgreSQL: pgsql/src/port/Makefile,v 1.21 2004-10-27 11:51:40 neilc Exp $
 
19
#
 
20
#-------------------------------------------------------------------------
 
21
 
 
22
subdir = src/port
 
23
top_builddir = ../..
 
24
include $(top_builddir)/src/Makefile.global
 
25
 
 
26
override CPPFLAGS := -I$(top_builddir)/src/port -DFRONTEND $(CPPFLAGS)
 
27
LIBS += $(PTHREAD_LIBS)
 
28
 
 
29
# Replace object files that use FRONTEND define
 
30
LIBOBJS_SRV := $(LIBOBJS)
 
31
LIBOBJS_SRV := $(patsubst dirmod.o,dirmod_srv.o, $(LIBOBJS_SRV))
 
32
LIBOBJS_SRV := $(patsubst exec.o,exec_srv.o, $(LIBOBJS_SRV))
 
33
LIBOBJS_SRV := $(patsubst getaddrinfo.o,getaddrinfo_srv.o, $(LIBOBJS_SRV))
 
34
LIBOBJS_SRV := $(patsubst thread.o,thread_srv.o, $(LIBOBJS_SRV))
 
35
 
 
36
all: libpgport.a libpgport_srv.a
 
37
 
 
38
# libpgport is needed by some contrib
 
39
install: all
 
40
        $(INSTALL_STLIB) libpgport.a $(DESTDIR)$(libdir)
 
41
 
 
42
uninstall:
 
43
        $(RM) $(DESTDIR)$(libdir)/libpgport.a
 
44
 
 
45
libpgport.a: $(LIBOBJS)
 
46
        $(AR) $(AROPT) $@ $^
 
47
 
 
48
thread.o: thread.c
 
49
        $(CC) $(CFLAGS) $(CPPFLAGS) $(PTHREAD_CFLAGS) -c $<
 
50
 
 
51
path.o: path.c pg_config_paths.h
 
52
 
 
53
#
 
54
# Server versions of object files
 
55
#
 
56
 
 
57
libpgport_srv.a: $(LIBOBJS_SRV)
 
58
        $(AR) $(AROPT) $@ $^
 
59
 
 
60
dirmod_srv.o: dirmod.c
 
61
        $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
 
62
 
 
63
exec_srv.o: exec.c
 
64
        $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
 
65
 
 
66
getaddrinfo_srv.o: getaddrinfo.c
 
67
        $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
 
68
 
 
69
# No thread flags for server version
 
70
thread_srv.o: thread.c
 
71
        $(CC) $(CFLAGS) $(subst -DFRONTEND,, $(CPPFLAGS)) -c $< -o $@
 
72
 
 
73
# Dependency is to ensure that path changes propagate
 
74
pg_config_paths.h: $(top_builddir)/src/Makefile.global
 
75
        echo "#define PGBINDIR \"$(bindir)\"" >$@
 
76
        echo "#define PGSHAREDIR \"$(datadir)\"" >>$@
 
77
        echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@
 
78
        echo "#define INCLUDEDIR \"$(includedir)\"" >>$@
 
79
        echo "#define PKGINCLUDEDIR \"$(pkgincludedir)\"" >>$@
 
80
        echo "#define INCLUDEDIRSERVER \"$(includedir_server)\"" >>$@
 
81
        echo "#define LIBDIR \"$(libdir)\"" >>$@
 
82
        echo "#define PKGLIBDIR \"$(pkglibdir)\"" >>$@
 
83
        echo "#define LOCALEDIR \"$(localedir)\"" >>$@
 
84
 
 
85
clean distclean maintainer-clean:
 
86
        rm -f libpgport.a libpgport_srv.a $(LIBOBJS) $(LIBOBJS_SRV) pg_config_paths.h