Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
blob: 03c57e57c6822f77a517d2beac5fc7795056d78f (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
#-------------------------------------------------------------------------
#
# Makefile--
#    Makefile for array iterator functions.
#
#-------------------------------------------------------------------------

PGDIR = ../..
SRCDIR = $(PGDIR)/src

include $(SRCDIR)/Makefile.global

INCLUDE_OPT =	-I ./ \
		-I $(SRCDIR)/ \
		-I $(SRCDIR)/include \
		-I $(SRCDIR)/port/$(PORTNAME)

CFLAGS += $(INCLUDE_OPT)

ifeq ($(PORTNAME), linux)
  ifdef LINUX_ELF
    ifeq ($(CC), gcc)
      CFLAGS += -fPIC
    endif
  endif
endif

ifeq ($(PORTNAME), i386_solaris)
  CFLAGS+= -fPIC
endif

MODNAME =	array_iterator

MODULE =	$(MODNAME)$(DLSUFFIX)

all:		module sql

module:		$(MODULE)

sql:		$(MODNAME).sql

install:	$(MODULE)
		cp -p $(MODULE) $(LIBDIR)
		cd $(LIBDIR); strip $(MODULE)

%.sql: %.sql.in
		sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@

.SUFFIXES: $(DLSUFFIX)

%$(DLSUFFIX): %.c
		cc $(CFLAGS) -shared -o $@ $<

depend dep:
		$(CC) -MM $(INCLUDE_OPT) *.c >depend

clean:
		rm -f $(MODULE) $(MODNAME).sql

ifeq (depend,$(wildcard depend))
include depend
endif