blob: 34faf548c107704cc696eeb11eb960fe61f62f26 (
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
|
SRCDIR= ../../..
include $(SRCDIR)/Makefile.global
PQ_INCLUDE=-I$(SRCDIR)/interfaces/libpq
SO_MAJOR_VERSION=1
SO_MINOR_VERSION=0
PORTNAME=@PORTNAME@
ifdef KRBVERS
CFLAGS+= $(KRBFLAGS)
endif
# Shared library stuff
shlib :=
install-shlib-dep :=
ifeq ($(PORTNAME), linux)
ifdef LINUX_ELF
install-shlib-dep := install-shlib
shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL = -shared
CFLAGS += $(CFLAGS_SL)
endif
endif
ifeq ($(PORTNAME), bsd)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib
shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL = -x -Bshareable -Bforcearchive
CFLAGS += $(CFLAGS_SL)
endif
endif
#ifeq ($(PORTNAME), i386_solaris)
# install-shlib-dep := install-shlib
# shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
# LDFLAGS_SL = -G -z text
# CFLAGS += $(CFLAGS_SL)
#endif
ifeq ($(PORTNAME), univel)
install-shlib-dep := install-shlib
shlib := libecpg.so.1
LDFLAGS_SL = -G -z text
CFLAGS += $(CFLAGS_SL)
endif
all: libecpg.a $(shlib)
$(shlib): ecpglib.o typename.o
$(LD) $(LDFLAGS_SL) -o $@ ecpglib.o typename.o
ln -sf $@ libecpg.so
clean:
rm -f *.o *.a core a.out *~ $(shlib) libecpg.so
install: libecpg.a $(shlib) $(install-shlib-dep)
$(INSTALL) $(INSTLOPTS) libecpg.a $(DESTDIR)$(LIBDIR)
install-shlib:
$(INSTALL) $(INSTLOPTS) $(shlib) $(DESTDIR)$(LIBDIR)
ln -sf $(shlib) $(DESTDIR)$(LIBDIR)/libecpg.so
uninstall::
rm -f $(DESTDIR)$(LIBDIR)/libecpg.a $(DESTDIR)$(LIBDIR)/$(shlib)
# Rules that do something
libecpg.a : libecpg.a(ecpglib.o) libecpg.a(typename.o)
ecpglib.o : ecpglib.c ../include/ecpglib.h ../include/ecpgtype.h
$(CC) $(CFLAGS) -I../include $(PQ_INCLUDE) -c ecpglib.c
typename.o : typename.c ../include/ecpgtype.h
$(CC) $(CFLAGS) -I../include $(PQ_INCLUDE) -c typename.c
|