Makefile 1.8 KB
Newer Older
M
Marc G. Fournier 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#-------------------------------------------------------------------------
#
# Makefile--
#    Makefile for the port-specific subsystem of the backend
#
# We have two different modes of operation: 1) put stuff specific to Port X
# in subdirectory X and have that subdirectory's make file make it all, and 
# 2) use conditional statements in the present make file to include what's
# necessary for a specific port in our own output.  (1) came first, but (2)
# is superior for many things, like when the same thing needs to be done for
# multiple ports and you don't want to duplicate files in multiple 
# subdirectories.  Much of the stuff done via Method 1 today should probably
# be converted to Method 2.  
#
# IDENTIFICATION
16
#    $PostgreSQL: pgsql/src/backend/port/Makefile,v 1.24 2007/01/07 08:49:31 petere Exp $
M
Marc G. Fournier 已提交
17 18 19
#
#-------------------------------------------------------------------------

20 21 22
subdir = src/backend/port
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
M
Marc G. Fournier 已提交
23

B
Bruce Momjian 已提交
24
OBJS+=dynloader.o pg_sema.o pg_shmem.o
P
Move  
Peter Eisentraut 已提交
25

26
OBJS+=$(TAS)
P
Move  
Peter Eisentraut 已提交
27

28
ifeq ($(PORTNAME), darwin)
29
OBJS+=darwin/SUBSYS.o
30
endif
31 32 33
ifeq ($(PORTNAME), win32)
OBJS+=win32/SUBSYS.o
endif
34

35
all: SUBSYS.o
M
Marc G. Fournier 已提交
36 37

SUBSYS.o: $(OBJS)
P
Move  
Peter Eisentraut 已提交
38
	$(LD) $(LDREL) $(LDOUT) $@ $^
M
Marc G. Fournier 已提交
39

40 41 42 43 44
darwin/SUBSYS.o: darwin.dir

darwin.dir:
	$(MAKE) -C darwin all

45 46 47 48 49
win32/SUBSYS.o: win32.dir

win32.dir:
	$(MAKE) -C win32 all

B
Bruce Momjian 已提交
50
tas.o: tas.s
51
ifeq ($(PORTNAME), solaris)
52
# preprocess assembler file with cpp, used by x86
53 54 55 56
	$(CC) $(CFLAGS) -c -P $<
	mv $*.i $*_cpp.s
	$(CC) $(CFLAGS) -c $*_cpp.s -o $@
else
57
	$(CC) $(CFLAGS) -c $<
58
endif
B
Bruce Momjian 已提交
59

60
# IPC test program
61
ipc_test: ipc_test.o pg_sema.o pg_shmem.o
62 63
	$(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(LIBS) -o $@

64
distclean clean:
65
	rm -f SUBSYS.o $(OBJS) ipc_test ipc_test.o tas_cpp.s
66
	$(MAKE) -C darwin clean
67
	$(MAKE) -C win32 clean