File: makefile

package info (click to toggle)
firebird4.0 4.0.6.3221.ds6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,964 kB
  • sloc: ansic: 393,248; cpp: 356,542; sql: 15,263; yacc: 8,713; fortran: 5,645; sh: 5,184; pascal: 3,328; makefile: 1,342; asm: 271; perl: 194; xml: 55; csh: 15; awk: 1
file content (131 lines) | stat: -rw-r--r-- 3,434 bytes parent folder | download | duplicates (2)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# The contents of this file are subject to the Interbase Public
# License Version 1.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy
# of the License at http://www.Inprise.com/IPL.html
#
# Software distributed under the License is distributed on an
# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
# or implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code was created by Inprise Corporation
# and its predecessors. Portions created by Inprise Corporation are
# Copyright (C) Inprise Corporation.
#
# All Rights Reserved.
# Contributor(s): ______________________________________.
# ---------------------------------------------------------------------

# -----------------------------------------------------------------------
# Firebird Installation Directory
#
# CHANGE this definition to point to your Firebird installation directory
# -----------------------------------------------------------------------
FIREBIRD	= /opt/firebird

DB    		= employee.fdb

INCLUDE		:= -I$(FIREBIRD)/include -I../include
FBCLIENT	= $(FIREBIRD)/lib/libfbclient.so
GPRE_M		= $(FIREBIRD)/bin/gpre -c -n -m
ISQL		= $(FIREBIRD)/bin/isql

# ---------------------------------------------------------------------
# General Compiler and linker Defines for Linux
# ---------------------------------------------------------------------
CC=		gcc
LINK=		gcc
LIB_LINK=	gcc
CFLAGS=		-c -std=c99 -g3 -Wall $(INCLUDE) -o
LIB_CFLAGS=	-fPIC -pthread $(CFLAGS)
LIB_LINK_FLAGS=	-shared -pthread -lfbclient -lrt -lm -ldl -lncurses
RM=		rm -f

#
# Do NOT change anything below this point.
# ---------------------------------------------------------------------
.PHONY: clean all

.SUFFIXES: .o .c .e

.e.c:
	$(GPRE_M) $< -d $(DB)

.c.o:
	$(CC) $< $(CFLAGS) $@

.o:
	$(LINK) -o $@ $< ${FBCLIENT} $(LINKFLAGS)


OUTBIN	= api1 api2 api3 api4 api5 api6 api7 api8 api9 api9f api10 api11 api12 api13 api14 api15 api16 api16t apifull

OUTCODE = api14.c

OBJS = *.o api9f.so

all:	api1 api2 api3 api4 api5 api6 api7 api8 api9f api9 api10 api11 api12 api13 api14 api15 api16 api16t apifull

api1.o: api1.c

api2.o: api2.c

api3.o: api3.c

api4.o: api4.c

api5.o: api5.c

api6.o: api6.c

api7.o: api7.c

api8.o: api8.c

api9f.o:api9f.c
	$(CC) $< $(LIB_CFLAGS) $@

api9f:	api9f.o api9f.sql
	$(CC) $@.o -o $@.so $(LIB_LINK_FLAGS)
	@echo ------------------------------------------------------
	@echo You may need to restart the firebird service
	@echo in order for api9f to work correctly.
	@echo ------------------------------------------------------
	cp api9f.so $(FIREBIRD)/UDF
	@echo Declaring desc_filter in database $(DB)
	$(ISQL) -e -i api9f.sql -o api9f.txt -m -m2 $(DB) 
	@echo ------------------------------------------------------

api9.o: api9.c

api9:	api9.o
	$(LINK) $@.o -o $@ ${FBCLIENT} $(LINKFLAGS)

api10.o: api10.c

api11.o: api11.c

api12.o: api12.c

api13.o: api13.c

api14.c: api14.e
	$(ISQL) -e -i ../empbuild/employe2.sql -o employe2.txt -m -m2
	$(GPRE_M) $< -d $(DB)

api14.o: api14.c

api15.o: api15.c

api16.o: api16.c

api16t.o: api16t.c

apifull.o: apifull.c

clean:
	$(RM) $(OBJS) $(OUTBIN) $(OUTCODE)
	@echo Dropping desc_filter in database $(DB)
	-$(ISQL) -echo -input api9fdrop.sql -output api9fdrop.txt -merge -m2 $(DB)
	$(RM) new.fdb desc.txt a.out api9f.txt api9fdrop.txt employe2.txt employe2.fdb