blob: 25f9db90b992d8bc92f2c3e639ef45db856b0745 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
#-------------------------------------------------------------------------
#
# postgres.mk--
# The master postgres makefile for implicit rules, definitions and
# variables. Every postgres makefile (except those that include
# postgres.subdir.mk only) should include this file.
#
# Copyright (c) 1994-5, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/mk/Attic/postgres.mk,v 1.5 1996/10/04 20:20:51 scrappy Exp $
#
#-------------------------------------------------------------------------
##############################################################################
#
# Default first rule (all):
# This is here so that people doing "gmake" without arguments will
# build the program (PROG), shell script (SHPROG) or library (LIB). To
# override this, you could define a rule before including postgres.mk.
# (See .dosomething: for an explanation of its presence.)
#
ifdef PROG
all: localobj $(PROG) .dosomething
else
ifdef SHPROG
all: localobj $(SHPROG) .dosomething
else
ifdef LIB
#all: localobj lib$(LIB).a install-headers .dosomething
all: localobj lib$(LIB).a
else
# if you don't define PROG, SHPROG or LIB before including this, use :: for
# your all. (this is here so that clean is not the first rule)
all:: localobj
endif
endif
endif
##############################################################################
#
# Flags for programs (ar, yacc, etc.)
#
YFLAGS= -d
RANLIB= touch
AROPT= crs
#AROPT= cq
LINTFLAGS =
#
# Installation.
#
# This is the default for all platforms. If your platform uses a different
# BSD-style install program, change it in src/mk/port/postgres.mk.$PORTNAME
INSTALL= installbsd
INSTLOPTS= -c -m 444
INSTL_EXE_OPTS= -c -m 555
INSTL_LIB_OPTS= -c -m 664
##############################################################################
#
# Canned command sequences
#
# making partial objects (if BIGOBJS is defined)
define make_partial
$(LD) -r -o $(objdir)/$(@F) $(addprefix $(objdir)/,$(notdir $^))
endef
# compiling a .c which is generated (and is in $objdir)
define cc_inobjdir
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(objdir)/$(<F) -o $(objdir)/$(@F)
endef
##############################################################################
#
# Variables
#
# Makefile.global is where the user configurations are. (objdir is defined
# there)
include $(MKDIR)/../Makefile.global
-include $(MKDIR)/port/postgres.mk.$(PORTNAME)
CURDIR:= $(shell pwd)
# This is where we put all the .o's and the generated files.
VPATH:= $(CURDIR)/$(objdir)
##############################################################################
#
# General rules
#
.PHONY: clean .dosomething localobj beforeinstall
# clean up the objects and generated files
clean:
@if test -d $(objdir); then cd $(objdir); rm -f $(CLEANFILES) ;else true; fi;
# just a matter of personal taste; make sure we do something and don't
# get this message: "gmake[1]: Nothing to be done for 'all'."
.dosomething:
@cat /dev/null
localobj:
@if test ! -d $(objdir); then mkdir $(objdir); else true; fi;
#
# create the directories before doing install
#
ifndef NO_BEFOREINSTL
beforeinstall: localobj
@-if test ! -d $(DESTDIR)$(LIBDIR); \
then mkdir $(DESTDIR)$(LIBDIR); fi
@-if test ! -d $(DESTDIR)$(BINDIR); \
then mkdir $(DESTDIR)$(BINDIR); fi
@-if test ! -d $(HEADERDIR); \
then mkdir $(HEADERDIR); fi
else
beforeinstall: localobj
endif
##############################################################################
#
# Implicit rules
#
# building .o from C++ sources
$(objdir)/%.o: %.cc
$(CXX) $(CXXFLAGS) -c $< -o $@
# building .o from .c (in $objdir):
$(objdir)/%.o: %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $(objdir)/$(@F)
# building .o from .s (in $objdir):
$(objdir)/%.o: %.s
$(AS) $(ASFLAGS) $< -o $(objdir)/$(@F)
|