Debian Codegraph @

examples/build_unix/Makefile.in.v5_examples

raw
1 # This library is free software; you can redistribute it and/or
2 # modify it under the terms of the GNU Lesser General Public
3 # License as published by the Free Software Foundation; either
4 # version 2.1 of the License, or (at your option) any later version.
5 # You may obtain a copy of the Licence at
6 # http://www.gnu.org/licences/lgpl.html
7 #
8 # As a special exception this file can also be included in modules
9 # with other source code as long as that source code has been
10 # released under an Open Source Initiative certificed licence.
11 # More information about OSI certification can be found at:
12 # http://www.opensource.org
13 #
14 # This module is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU Lesser General Public Licence for more details.
18 #
19 # This module was created by members of the firebird development
20 # team. All individual contributions remain the Copyright (C) of
21 # those individuals and all rights are reserved. Contributors to
22 # this file are either listed below or can be obtained from a CVS
23 # history command.
24 #
25 # Created by: Mark O'Donohue <[email protected]>
26 #
27 # Contributor(s):
28 #
29 #
30 # $Id: Makefile.in.v5_examples,v 1.1 2003-07-11 13:30:32 brodsom Exp $
31 #
32 ROOT=../..
33 ObjModuleName=v5_examples
34
35 # Add the install include directory to the search path since the
36 # examples need to build using those headers values.
37
38 CFLAGS := $(CFLAGS) -I../firebird/include
39
40
41 include $(ROOT)/gen/make.defaults
42 include $(ROOT)/gen/make.platform
43 include $(ROOT)/gen/make.rules
44 include $(ROOT)/gen/make.shared.variables
45
46 @SET_MAKE@
47
48 PATH := ./:$(BIN):$(PATH)
49 export PATH
50
51
52 GPRE_FLAGS= -r -m -z -n
53
54 EXAMPLES_DEST= $(FIREBIRD)/examples/v5/
55 EXAMPLES_SRC= $(SRC_ROOT)/v5_examples/
56
57
58 EMPBLD_Objects= empbuild.o
59
60 INTLBLD_Objects= intlbld.o
61
62 INPUT_FILES= empddl.sql empdml.sql indexoff.sql indexon.sql \
63 job.inp lang.inp proj.inp qtr.inp
64
65 INTL_FILES= intlddl.sql intldml.sql indexoff.sql indexon.sql \
66 job.inp lang.inp proj.inp qtr.inp
67
68 EXAMPLE_FILES= readme align.h api1.c api10.c api11.c api12.c api13.c \
69 api14.e api15.c api16.c api16t.c api2.c api3.c api4.c \
70 api5.c api6.c api7.c api8.c api9.c api9f.c apifull.c \
71 employe2.sql dyn1.e dyn2.e dyn3.e dyn4.e dyn5.e dynfull.e \
72 example.h api9f.sql stat1.e stat10.e stat11.e stat12.e \
73 stat12t.e stat2.e stat3.e stat4.e stat5.e stat6.e stat7.e \
74 stat8.e stat9.e udf.sql udflib.c
75
76 EXAMPLES= $(addprefix $(EXAMPLES_DEST), $(EXAMPLE_FILES))
77
78 NT_EXAMPLES_FILES= api9f.def udflib.def #makefile.bc makefile.msc
79
80 NT_EXAMPLES= $(addprefix $(EXAMPLES_DEST), $(NT_EXAMPLE_FILES))
81
82 EXAMPLE_DB= $(EXAMPLES_DEST)employee.fdb
83
84
85 .PHONY: all v5_examples
86
87 all: v5_examples
88
89 # PR 2002-06-23 - Temporarily removed intlemp from the build as it caused a segfault
90 # The lines to change back are prefixed with ##
91 ##v5_examples: employee.fdb intlemp.fdb $(EXAMPLE_SRC)Makefile
92 v5_examples: $(EXAMPLE_DB) $(EXAMPLES) $(NT_EXAMPLES)
93
94 $(EXAMPLES_DEST)% : $(EXAMPLES_SRC)%
95 $(CP) $^ $@
96
97 $(EXAMPLE_DB) : employee.fdb
98 $(GBAK_STATIC) employee.fdb $(EXAMPLES_DEST)employee.gbk
99 # -$(RM) $(EXAMPLE_DB)
100 $(GBAK_STATIC) -r $(EXAMPLES_DEST)employee.gbk $(EXAMPLE_DB)
101
102 # Ok the following little story is, first build empbuild.fdb an empty db
103 # using a script file. Then we can compile the empbuild.e file, then we
104 # can run it to create employee.fdb database populated with data by the
105 # program. Thats how I found it.
106 # MOD July-2001
107 #
108 # Another problem here is that empbuild does not fail when it gets an error
109 # so MAKE thinks it's all run ok. empbuild should be modified to return an
110 # error when it fails.
111 # MOD 28-July-2002
112
113
114 employee.fdb: empbuild$(EXEC_EXT) $(INPUT_FILES) isql$(EXEC_EXT)
115 -$(RM) employee.fdb
116 ./empbuild employee.fdb
117 -$(CHMOD_6) employee.fdb
118
119 # To get past the fact isql is called from the programs, we create a local link
120 # to the static one in this directory
121
122 isql$(EXEC_EXT):
123 -$(LN) $(ISQL_STATIC) isql$(EXEC_EXT)
124
125 empbuild$(EXEC_EXT): $(EMPBLD_Objects) $(LIBFBCOMMON_A) $(LIBFBSTATIC_A)
126 $(EXE_LINK) $(LINK_OPTS) $(EMPBLD_Objects) -o $@ -L$(LIB) -lfbstatic -lfbcommon $(LINK_LIBS)
127
128 empbuild.c: empbuild.fdb empbuild.e
129
130 empbuild.fdb : $(EXAMPLES_SRC)empddl.sql $(EXAMPLES_SRC)empbld.sql
131 -$(CP) $^ .
132 -$(RM) $@
133 $(ISQL_STATIC) -i empbld.sql
134
135 # The chain for intlemp.fdb is the same a script file to create an empty database
136 # to allow a .e program to be compiled, to then create and populate with data
137 # the intlemp.fdb database.
138
139 intlemp.fdb: intlbld$(EXEC_EXT) $(INTL_FILES)
140 -$(RM) intlemp.fdb
141 # $(CP) $(SRC_ROOT)/examples/intlddl.sql .
142 # $(CP) $(SRC_ROOT)/examples/indexoff.sql .
143 # $(CP) $(SRC_ROOT)/examples/indexon.sql .
144 # $(CP) $(SRC_ROOT)/examples/intldml.sql .
145 # $(CP) $(SRC_ROOT)/examples/lang.inp .
146 ./intlbld intlemp.fdb
147 -$(CHMOD_6) intlemp.fdb
148
149 intlbuild.fdb : intlddl.sql intlbld.sql
150 -$(RM) intlbuild.fdb
151 $(ISQL_STATIC) -i intlbld.sql
152
153
154 intlbld: $(INTLBLD_Objects) $(LIBFBCOMMON_A) $(LIBFBSTATIC_A)
155 -$(RM) $@
156 $(EXE_LINK) $(LINK_OPTS) $(INTLBLD_Objects) -o $@ -L$(LIB) -lfbstatic -lfbcommon $(LINK_LIBS)
157
158 intlbld.exe: $(INTLBLD_OBJ)
159 -$(RM) intlbld.exe
160 $(CC) $(O_EXE_SWITCH)intlbld $(LINK_OPTS) intlbld.o $(GDS_LINK)
161
162
163 intlbld.c: intlbuild.fdb intlbld.e
164
165
166
167 %.sql:: $(SRC_ROOT)/v5_examples/%.sql
168 $(CP) $^ $@
169
170 %.inp:: $(SRC_ROOT)/v5_examples/%.inp
171 $(CP) $^ $@
172
173 %.e:: $(SRC_ROOT)/v5_examples/%.e
174 $(CP) $^ $@