Makefile.in 1.8 KB
Newer Older
M
Marc G. Fournier 已提交
1 2 3
SRCDIR= ../../..
include $(SRCDIR)/Makefile.global

4
PQ_INCLUDE=-I$(SRCDIR)/interfaces/libpq
M
Marc G. Fournier 已提交
5

6
SO_MAJOR_VERSION=1
7
SO_MINOR_VERSION=1
8 9

PORTNAME=@PORTNAME@
M
Marc G. Fournier 已提交
10

11 12 13 14
ifdef KRBVERS
CFLAGS+= $(KRBFLAGS)
endif

M
Marc G. Fournier 已提交
15 16 17 18 19 20 21 22 23 24 25 26
# 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)
27 28 29 30 31 32
  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
M
Marc G. Fournier 已提交
33
endif
34 35 36 37 38 39
#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
M
Marc G. Fournier 已提交
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
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

B
Hi,  
Bruce Momjian 已提交
56 57
dep depend:

M
Marc G. Fournier 已提交
58
install: libecpg.a $(shlib) $(install-shlib-dep)
B
Bruce Momjian 已提交
59
	$(INSTALL) $(INSTLOPTS) libecpg.a $(LIBDIR)
M
Marc G. Fournier 已提交
60 61

install-shlib:
B
Bruce Momjian 已提交
62 63
	$(INSTALL) $(INSTLOPTS) $(shlib) $(LIBDIR)
	ln -sf $(shlib) $(LIBDIR)/libecpg.so
M
Marc G. Fournier 已提交
64 65

uninstall::
B
Bruce Momjian 已提交
66
	rm -f $(LIBDIR)/libecpg.a $(LIBDIR)/$(shlib)
M
Marc G. Fournier 已提交
67 68 69 70 71

# Rules that do something
libecpg.a : libecpg.a(ecpglib.o) libecpg.a(typename.o)

ecpglib.o : ecpglib.c ../include/ecpglib.h ../include/ecpgtype.h
72
	$(CC) $(CFLAGS) -I../include $(PQ_INCLUDE) -c ecpglib.c
M
Marc G. Fournier 已提交
73
typename.o : typename.c ../include/ecpgtype.h
74
	$(CC) $(CFLAGS) -I../include $(PQ_INCLUDE) -c typename.c