|
| 1 | +#------------------------------------------------------------------------- |
| 2 | +# |
| 3 | +# Makefile |
| 4 | +# Makefile for pgeasy library |
| 5 | +# |
| 6 | +# IDENTIFICATION |
| 7 | +# $Header: /cvsroot/pgsql/src/interfaces/pgeasy/Attic/Makefile.in,v 1.1 1999/10/11 17:47:01 momjian Exp $ |
| 8 | +# |
| 9 | +#------------------------------------------------------------------------- |
| 10 | + |
| 11 | +NAME= pgeasy |
| 12 | +SO_MAJOR_VERSION= 2 |
| 13 | +SO_MINOR_VERSION= 0 |
| 14 | + |
| 15 | +SRCDIR= @top_srcdir@ |
| 16 | +include $(SRCDIR)/Makefile.global |
| 17 | + |
| 18 | +ifdef KRBVERS |
| 19 | +CFLAGS+= $(KRBFLAGS) |
| 20 | +endif |
| 21 | + |
| 22 | +OBJS= pgeasy.o halt.o |
| 23 | + |
| 24 | +SHLIB_LINK+= -L../libpq -lpq |
| 25 | + |
| 26 | +SHLIB_LINK+= -L../libpq -lpq |
| 27 | + |
| 28 | +# If crypt is a separate library, rather than part of libc, it may need |
| 29 | +# to be referenced separately to keep (broken) linkers happy. (This is |
| 30 | +# braindead; users of libpq should not need to know what it depends on.) |
| 31 | +SHLIB_LINK+= $(findstring -lcrypt,$(LIBS)) |
| 32 | + |
| 33 | +# Shared library stuff, also default 'all' target |
| 34 | +include $(SRCDIR)/Makefile.shlib |
| 35 | + |
| 36 | + |
| 37 | +.PHONY: install install-headers |
| 38 | + |
| 39 | +install: install-headers install-lib $(install-shlib-dep) |
| 40 | + |
| 41 | +install-headers: pgeasy.h |
| 42 | + @if [ ! -d $(HEADERDIR) ]; then mkdir $(HEADERDIR); fi |
| 43 | + $(INSTALL) $(INSTLOPTS) pgeasy.h $(HEADERDIR)/pgeasy.h |
| 44 | + |
| 45 | +.PHONY: clean |
| 46 | + |
| 47 | +clean: clean-shlib |
| 48 | + rm -f lib$(NAME).a $(OBJS) |
| 49 | + |
| 50 | +depend dep: |
| 51 | + $(CC) -MM $(CFLAGS) *.c >depend |
| 52 | + |
| 53 | +ifeq (depend,$(wildcard depend)) |
| 54 | +include depend |
| 55 | +endif |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +PGEASY = pgeasy.o halt.o |
| 60 | +TARGET = libpgeasy.a pginsert pgwordcount pgnulltest |
| 61 | +CFLAGS = -g -Wall -I. -I../../src/interfaces/libpq -I/usr/local/pgsql/include |
| 62 | +LDFLAGS = -L/usr/local/pgsql/lib -lpq |
| 63 | + |
| 64 | +all : $(TARGET) |
| 65 | + |
| 66 | +libpgeasy.a: pgeasy.o halt.o |
| 67 | + ar r libpgeasy.a pgeasy.o halt.o |
| 68 | + |
| 69 | +pgeasy.o: pgeasy.c |
| 70 | + gcc -c $(CFLAGS) pgeasy.c |
| 71 | + |
| 72 | +halt.o: halt.c |
| 73 | + gcc -c $(CFLAGS) halt.c |
| 74 | + |
| 75 | +pginsert: $(PGEASY) pginsert.c |
| 76 | + gcc -o $@ $(CFLAGS) $@.c $(PGEASY) $(LDFLAGS) |
| 77 | + |
| 78 | +pgwordcount: $(PGEASY) pgwordcount.c |
| 79 | + gcc -o $@ $(CFLAGS) $@.c $(PGEASY) $(LDFLAGS) |
| 80 | + |
| 81 | +pgnulltest: $(PGEASY) pgnulltest.c |
| 82 | + gcc -o $@ $(CFLAGS) $@.c $(PGEASY) $(LDFLAGS) |
| 83 | + |
| 84 | +clean: |
| 85 | + rm -f *.o $(TARGET) log core |
| 86 | + |
| 87 | +install: |
| 88 | + install -s -o bin -g bin $(TARGET) /usr/local/pgsql/bin |
| 89 | + |
0 commit comments