File: Makefile

package info (click to toggle)
db5.3 5.3.28%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 158,500 kB
  • sloc: ansic: 448,411; java: 111,824; tcl: 80,544; sh: 44,264; cs: 33,697; cpp: 21,604; perl: 14,557; xml: 10,799; makefile: 4,077; javascript: 1,998; yacc: 1,003; awk: 965; sql: 801; erlang: 342; python: 216; php: 24; asm: 14
file content (110 lines) | stat: -rw-r--r-- 3,714 bytes parent folder | download | duplicates (10)
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
#!/usr/make
#
# Makefile for DBSQL BFile
#
# This makefile is suppose to be build for linux and windriver-ovia.
# But if that does not work for you, you can configure the makefile 
# manually.  Just set the parameters below to values that
# work well for your system.
#

# The toplevel directory of the source tree.
#
TOP = ../
# When manipulating BFILE, if you want to use c-functions set it to 1;
# Otherwise, set it to zero
ENABLE_BFILE_CAPI = 0

# The ovia options
#
ifeq ($(BUILD_OVIA), 1)
CROSS_COMPILE = arm-wrs-linux-gnueabi-arm_novfp-glibc_small-
CFLAGS += -msoft-float
CFLAGS += -I$(WIND_BASE)/wrlinux/target-libs/glibc_small/arm-wrs-linux-gnueabi-arm_novfp/include
CFLAGS += -L$(WIND_BASE)/wrlinux/target-libs/glibc_small/arm-wrs-linux-gnueabi-arm_novfp/lib
#TLIBS += -ldl
endif

# C Compile and options for use in building executables that 
# will run on the target platform.
#
TCC = $(CROSS_COMPILE)gcc
TCC += $(CFLAGS) -fPIC -O3 -I${TOP}/include -I$(DBSQL_DIR)/include -I../../../../generated -I../../../src
ifeq ($(ENABLE_BFILE_CAPI), 1)
TCC += -DBFILE_USE_CAPIS
endif

# Any target libraries which libsqlite must be linked against
# 
TLIBS += -lpthread -ldl

# The directory into which to store package information for

# Some standard variables and programs
#
prefix = $(DBSQL_DIR)
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
includedir = ${prefix}/include
INSTALL = /usr/bin/install -c

# You should not have to change anything below this line
###############################################################################


# This is the default Makefile target.  The objects listed here
# are what get build when you type just "make" with no arguments.
#
ifndef DBSQL_DIR
all:
	echo "Please set the correct path for DBSQL_DIR"
else
all:	libbfile_ext.so bfile_test bfile_example
endif

libbfile_ext.so:	$(TOP)/src/bfile.c $(TOP)/include/bfile.h
	$(TCC) $(TOP)/src/bfile.c -o libbfile_ext.so -shared

ifeq ($(ENABLE_BFILE_CAPI), 0)
bfile_test:	$(TOP)/test/bfile_test_sql.c $(TOP)/include/bfile.h libbfile_ext.so
	$(TCC) $(TOP)/test/bfile_test_sql.c -o bfile_test_sql $(TLIBS) -L. -lbfile_ext -L$(DBSQL_DIR)/lib -ldb_sql -ldl
bfile_example:	$(TOP)/examples/bfile_example_sql.c $(TOP)/include/bfile.h libbfile_ext.so
	$(TCC) $(TOP)/examples/bfile_example_sql.c -o bfile_example_sql $(TLIBS) -L. -lbfile_ext -L$(DBSQL_DIR)/lib -ldb_sql -ldl
else
bfile_test:	$(TOP)/test/bfile_test_capi.c $(TOP)/include/bfile.h libbfile_ext.so
	$(TCC) $(TOP)/test/bfile_test_capi.c -o bfile_test_capi $(TLIBS) -L. -lbfile_ext -L$(DBSQL_DIR)/lib -ldb_sql -ldl
bfile_example:	$(TOP)/examples/bfile_example_capi.c $(TOP)/include/bfile.h libbfile_ext.so
	$(TCC) $(TOP)/examples/bfile_example_capi.c -o bfile_example_capi $(TLIBS) -L. -lbfile_ext -L$(DBSQL_DIR)/lib -ldb_sql -ldl
endif
install:	libbfile_ext.so $(TOP)/include/bfile.h
	$(INSTALL) -m 0755 libbfile_ext.so $(DESTDIR)$(libdir)
	$(INSTALL) -m 0644 $(TOP)/include/bfile.h $(DESTDIR)$(includedir)

clean:	
	rm -rf *.jpg *.db* libbfile_ext.so bfile_test bfile_example

# Makefile can not test for ovia. It sould be copy to ovia platform.
# The follow target only suit for linux.
#
ifeq ($(BUILD_OVIA), 0)
test:	bfile_test
	env LD_LIBRARY_PATH=.:$(DBSQL_DIR)/lib:$(LD_LIBRARY_PATH) ./bfile_test
endif

ifdef TESTFIXTURE
ifdef TEST_DIR
tcl_test:	$(TOP)/test/bfile.test
	cp $(TOP)/test/bfile.test $(TEST_DIR)/
	env LD_LIBRARY_PATH=.:$(DBSQL_DIR)/lib:$(LD_LIBRARY_PATH) $(TESTFIXTURE) $(TEST_DIR)/bfile.test
else
tcl_test:
	-echo "Please set the correct fullpath for TEST_DIR"
endif
else
tcl_test:
	-echo "Please set the correct fullpath for TESTFIXTURE"
endif

run:	bfile_example
	env LD_LIBRARY_PATH=.:$(DBSQL_DIR)/lib:$(LD_LIBRARY_PATH) ./bfile_example