aboutsummaryrefslogtreecommitdiff
path: root/contrib/odbc/Makefile
blob: 8fe1959c58db9ac925f8477b6ad59b28e788773a (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
# ODBC extensions
# Thomas Lockhart 2000-04-03

SRCDIR= ../../src

include $(SRCDIR)/Makefile.global

ifndef PGLIB
  PGLIB= .
endif

CFLAGS+= $(CFLAGS_SL)

TARGETS_7= odbc.sql
TARGETS_PRE7= odbc$(DLSUFFIX) odbc-pre7.sql

TARGETS= $(TARGETS_7)

CLEANFILES+= $(TARGETS) $(TARGETS_PRE7)

all:: $(TARGETS)

install: all
ifneq ($(filter odbc$(DLSUFFIX), $(TARGETS)),)
	-test -d $(PGLIB) || $(INSTALL) -d $(PGLIB)
	$(INSTALL) odbc$(DLSUFFIX) $(PGLIB)
endif

pre7:
	$(MAKE) TARGETS="$(TARGETS) $(TARGETS_PRE7)"

install-pre7:
	$(MAKE) TARGETS="$(TARGETS) $(TARGETS_PRE7)" install

odbc-pre7.sql: odbc-pre7.source odbc.sql
	rm -f $@; \
	cat $^ \
	| sed -e "s:_OBJWD_:$(PGLIB):g" \
	      -e "s:_DLSUFFIX_:$(DLSUFFIX):g" \
	      -e "s:float(15):float8:g" > $@

%.sql: %.source
	rm -f $@; \
	sed -e "s:_OBJWD_:$(PGLIB):g" \
	    -e "s:_DLSUFFIX_:$(DLSUFFIX):g" < $< > $@

clean:
	rm -f $(TARGETS) *.o