root / extras / Makefile @ e27cb406a8e0181c7880525ed996d20947ed7214

View | Annotate | Download (4.3 KB)

1
# $Id: Makefile,v 1.68 2008/02/06 19:43:52 eveogro Exp $
2
# Warren W. Gay VE3WWG
3
#
4
# Licensed under the ACL (Ada Community License)
5
# or GPL2 :
6
7
include Makeincl
8
9
DISTDIR=apq-$(VERSION)
10
DISTFILE=apq-$(VERSION).tar.gz
11
12
#DBG=-g
13
OPTZ=-O0
14
15
CC=gcc
16
17
ZOPTS=$(DBG) $(OPTZ)
18
COPTS=-Wall $(ZOPTS)
19
AOPTS=-gnata -gnatf -gnato -gnatwp $(ZOPTS)
20
21
.c.o:
22
	$(CC) -c $(COPTS) $(ZOPTS) $(PG_INCL) $(MY_INCL) $< -o $*.o
23
24
all:	sybase$(HAVE_SY) setup$(HAVE_MY) mysql$(HAVE_MY) postgresql$(HAVE_PG) libapq.a finish
25
26
tmysql::
27
	rm -f tmysql mysql.trc
28
	gnatmake -gnatf tmysql
29
30
31
setup0:        # MySQL support is not being included
32
sybase0:       # Sybase support is not being included
33
mysql0:        # MySQL support is not being included
34
postgresql0:   # PostgreSQL is not being included
35
36
apq-sybase.ads: apq-sybase.ads-in sybase_gentyp.c prep_sybase
37
	$(CC) $(COPTS) $(SY_INCL) sybase_gentyp.c -o sybase_gentyp
38
	$(CC) $(COPTS) $(SY_INCL) sybaseopts.c -o sybaseopts
39
	./sybaseopts >sybopts.tmp
40
	./sybase_gentyp | ./prep_sybase "$(SY_LIBS)" >apq-sybase.ads
41
	rm -f sybase_gentyp
42
43
c_sybase.o: c_sybase.c
44
	$(CC) -c $(COPTS) $(ZOPTS) $(SY_INCL) $< -o c_sybase.o
45
46
sybase1: apq-sybase.ads c_sybase.o
47
	gnatmake -c $(AOPTS) comp_sybase
48
49
setup1:	mysql_xcr mysql_xcr2 mysql_xcr3 mysql_incl
50
	chmod u+x mysql_xcr mysql_xcr2 mysql_xcr3 mysql_incl mysql_xty mysql_linker_options
51
52
mysql1: apq-mysql.ads c_mysql.o
53
	gnatmake -c $(AOPTS) comp_mysql
54
55
c_mysql.o: c_mysql.c
56
	$(CC) -c $(COPTS) $(ZOPTS) $(MY_INCL) c_mysql.c -o c_mysql.o
57
58
apq-mysql.ads: apq-mysql.ads-in mysql_generr.c mysql_xcr2 mysql_xcr3
59
	@rm -f mysql_errmsg.h mysql_generr
60
	./mysql_xcr >mysql_errmsg.h
61
	./mysql_xty >mysql_type_codes.h
62
	$(CC) $(COPTS) $(MY_INCL) mysql_generr.c -o mysql_generr
63
	$(CC) $(COPTS) $(MY_INCL) mysql_gentyp.c -o mysql_gentyp
64
	$(CC) $(COPTS) $(MY_INCL) mysqlopts.c -o mysql_opts
65
	./mysql_opts >opts.tmp
66
	./mysql_generr | sort -k1,1n | ./mysql_xcr2 >gen.tmp
67
	./mysql_gentyp | sort -k1,1n | ./mysql_xcr3
68
	rm -f mysql_generr mysql_errmsg.h mysql_gentyp mysql_type_codes.h gen.tmp opts.tmp mysql_opts gen.tmp
69
70
postgresql1: numeric.o notices.o
71
	gnatmake -c $(AOPTS) comp_pg
72
73
libapq.a::
74
	@rm -f libapq.a
75
	ar cr libapq.a apq.o $(PG_OBJS) $(MY_OBJS) $(SY_OBJS)
76
	ar tv libapq.a
77
78
finish:
79
	@echo "--"
80
	@echo "Now do 'make install' to install the library"
81
	@echo
82
	@echo "NOTE: Remove any prior versions of the APQ library"
83
	@echo "and package, if you have it installed. You will"
84
	@echo "need to remove those packages and libraries"
85
	@echo "manually."
86
	@echo
87
	@echo "You may 'make uninstall' if you are about to"
88
	@echo "reinstall APQ version $(VERSION). This will not"
89
	@echo "work for prior versions of APQ however."
90
	@echo
91
92
install: libapq.a
93
	HAVE_PG=$(HAVE_PG) HAVE_MY=$(HAVE_MY) HAVE_SY=$(HAVE_SY) ./install_lib
94
	@echo "--"
95
	@echo "For fun do:"
96
	@echo "  1. cd ./eg2"
97
	@echo "  2. make"
98
	@echo "  3. follow instructions given."
99
	@echo "--"
100
	
101
uninstall:
102
	HAVE_PG=1 HAVE_MY=1 HAVE_SY=1 ./install_lib uninstall
103
104
reinstall: uninstall clobber all install
105
106
clean:
107
	rm -f *.o *.ali *.core b~*.ad[sb] errs.t libapq.a mysql.trc comp_pg comp_mysql
108
	rm -f sybase_gentyp gen.tmp sybopts.tmp sybaseopts
109
	rm -f mysql_gentyp mysql_opts opts.tmp
110
	(cd sybase ; make clean)
111
112
clobber: clean
113
	rm -f mysql_errmsg.h mysql_type_codes.h mysql_generr Makeincl tmysql apq-mysql.ads
114
	rm -f tsybase apq-sybase.ads
115
	rm -f libapq.a GNUmakefile
116
	rm -fr ./release $(DISTFILE)
117
	cd ./eg; $(MAKE) clobber
118
	rm -f apq-1.93-win32-2.7.1.tar.gz
119
	rm -f apq_manual.dvi apq_manual.pdf binding2.aux binding2.toc binding2.log
120
	(cd sybase ; make clobber)
121
122
manual:	apq_manual.pdf
123
124
apq_manual.dvi: binding2.tex
125
	@rm -f binding2.toc binding2.log binding2.dvi binding2.aux
126
	latex binding2.tex
127
	latex binding2.tex
128
	latex binding2.tex
129
	mv binding2.dvi apq_manual.dvi
130
131
apq_manual.pdf: apq_manual.dvi
132
	dvipdf apq_manual.dvi apq_manual.pdf
133
134
manlabels:
135
	sed <binding2.tex -n '/\\label{.*}/p' | sed 's|.*\(\\label{.*}\).*$$|\1|g'
136
137
distribution: manual
138
	./build_release
139
	@mv release $(DISTDIR)
140
	tar czf $(DISTFILE) $(DISTDIR)
141
	@rm -fr $(DISTDIR)
142
	@ls -l $(DISTFILE)
143
144
makedist:
145
	./build_release FORCE
146
	@mv release $(DISTDIR)
147
	tar czf $(DISTFILE) $(DISTDIR)
148
	@rm -fr $(DISTDIR)
149
	@ls -l $(DISTFILE)
150
151
#binary-distributions:
152
#	./build_release build-win32-1.93-2.7.1
153
#	@mv release apq-1.93-win32-2.7.1
154
#	tar czf apq-1.93-win32-2.7.1.tar.gz apq-1.93-win32-2.7.1
155
#	rm -fr apq-1.93-win32-2.7.1
156
#	ls -l apq-1.93-win32-2.7.1.tar.gz
157
158
# End $Source: /cvsroot/apq/apq/Makefile,v $