Makefile 3.31 KB
Newer Older
Rich Prohaska's avatar
Rich Prohaska committed
1 2 3 4 5 6 7 8 9 10 11 12 13
# How to build db.h_4_4
# 1. cd ../../berkeleydb/db-4.4.20; ../dist/configure; make; make install
# 2. on both 32 and 64 bit architectures
#	make sample_offsets_4_4
# 3. gather the sample_offsets_32/64_4_4.h files into a single directory
# 4. make db.h_4_4
#
# How to build all of the db.h files
# 1. install all of the bdb's
# 2. make samples
# 3. gather the generated sample_offsets header files
# 4. make hs

14
BDB = 4_4
15
BDBDIR = ../../../berkeleydb
Rich Prohaska's avatar
Rich Prohaska committed
16
MYSQL_H = -I$(BDBDIR)/db-4.1.25/build_unix/
Rich Prohaska's avatar
Rich Prohaska committed
17 18
OPTFLAGS = -O2
CFLAGS = -Wall -W -Werror -g $(OPTFLAGS)
Rich Prohaska's avatar
Rich Prohaska committed
19

20
runs: runs_mysql runs_installed
Rich Prohaska's avatar
Rich Prohaska committed
21 22
samples: sample_offsets_4_6 sample_offsets_4_5 sample_offsets_4_4 sample_offsets_4_3 sample_offsets_4_1
hs: db.h_4_6 db.h_4_5 db.h_4_4 db.h_4_3 db.h_4_1
23 24 25 26 27
# the mysql versions use the header in the mysql distribution.
runs_mysql: ./sample_offsets_mysql
	./sample_offsets_mysql
runs_installed: sample_offsets
	./sample_offsets
28
sample_offsets_mysql: CPPFLAGS=$(MYSQL_H)
29 30 31
sample_offsets_mysql: sample_offsets.c
	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@

32
make_db_h_4_1.o: make_db_h.c sample_offsets_32_4_1.h sample_offsets_64_4_1.h
Rich Prohaska's avatar
Rich Prohaska committed
33
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.1.25/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=1
34 35
db.h_4_1: make_db_h_4_1
	./make_db_h_4_1 > $@
Rich Prohaska's avatar
Rich Prohaska committed
36 37 38
sample_offsets_4_1: sample_offsets.c
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.1.25/build_unix $< -o $@
	./sample_offsets_4_1
39 40

make_db_h_4_3.o: make_db_h.c sample_offsets_32_4_3.h sample_offsets_64_4_3.h
Rich Prohaska's avatar
Rich Prohaska committed
41
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.3.29/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=3
42 43
db.h_4_3: make_db_h_4_3
	./make_db_h_4_3 > $@
Rich Prohaska's avatar
Rich Prohaska committed
44 45 46 47 48 49 50 51 52 53 54 55
sample_offsets_4_3: sample_offsets.c
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.3.29/build_unix $< -o $@
	./sample_offsets_4_3

make_db_h_4_4.o: make_db_h.c sample_offsets_32_4_4.h sample_offsets_64_4_4.h
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.4.20/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=4
db.h_4_4: make_db_h_4_4
	./make_db_h_4_4 > $@
sample_offsets_4_4: sample_offsets.c
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.4.20/build_unix $< -o $@
	./sample_offsets_4_4

Rich Prohaska's avatar
Rich Prohaska committed
56 57 58 59 60 61 62 63
make_db_h_4_5.o: make_db_h.c sample_offsets_32_4_5.h sample_offsets_64_4_5.h
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.5.20/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=5
db.h_4_5: make_db_h_4_5
	./make_db_h_4_5 > $@
sample_offsets_4_5: sample_offsets.c
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.5.20/build_unix $< -o $@
	./sample_offsets_4_5

Rich Prohaska's avatar
Rich Prohaska committed
64 65 66 67 68 69 70
make_db_h_4_6.o: make_db_h.c sample_offsets_32_4_6.h sample_offsets_64_4_6.h
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.6.19/build_unix $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=6
db.h_4_6: make_db_h_4_6
	./make_db_h_4_6 > $@
sample_offsets_4_6: sample_offsets.c
	$(CC) $(CFLAGS) -I. -I$(BDBDIR)/db-4.6.19/build_unix $< -o $@
	./sample_offsets_4_6
71

72 73 74 75 76
sample_offsets:
sample_offsets_local: ./db.h
sample_offsets_local: sample_offsets.c
	$(CC) $(CFLAGS) -I. -DLOCAL $< -o $@
 
77
hfiles: db.h_4_1 db.h_4_3 db.h_4_4 db.h_4_5 db.h_4_6
78

79 80 81
check32: sample_offsets_local
	./sample_offsets_local
	diff sample_offsets_local.h sample_offsets_32.h
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
82

Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
83
clean:
84
	rm -f sample_offsets_mysql sample_offsets sample_offsets_?_? *.o make_db_h_?_?
Rich Prohaska's avatar
Rich Prohaska committed
85 86
install: db.h_$(BDB)
	cp db.h_$(BDB) ../include/db.h
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
87

Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
88
# Note: To make the compile work, you must cd to the ../../berkeleydb/db-4.1.25/build_unix
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
89
# and do ../dist/configure
Bradley C. Kuszmaul's avatar
up  
Bradley C. Kuszmaul committed
90 91 92

# to build mysql-5.0.27 with berkeley db 4.1.25
# ./configure --with-berkeley-db=../../berkeleydb/db-4.1.25/build_unix