Makefile 1.22 KB
Newer Older
1
CFLAGS = -Wall -W -O2 -Werror -g
2
MYSQL_H = -I../../mysql-5.0.27/mysql-5.0.27/bdb/build_unix/
3 4 5 6 7 8
runs: runs_mysql runs_installed
# the mysql versions use the header in the mysql distribution.
runs_mysql: ./sample_offsets_mysql
	./sample_offsets_mysql
runs_installed: sample_offsets
	./sample_offsets
9
sample_offsets_mysql: CPPFLAGS=$(MYSQL_H)
10 11 12
sample_offsets_mysql: sample_offsets.c
	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@

13 14 15 16 17 18 19 20 21 22
make_db_h_4_1.o: make_db_h.c sample_offsets_32_4_1.h sample_offsets_64_4_1.h
	$(CC) $(CFLAGS) -I. $(MYSQL_H) $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=1
db.h_4_1: make_db_h_4_1
	./make_db_h_4_1 > $@

make_db_h_4_3.o: make_db_h.c sample_offsets_32_4_3.h sample_offsets_64_4_3.h
	$(CC) $(CFLAGS) -I. $< -c -o $@ -DUSE_MAJOR=4 -DUSE_MINOR=3
db.h_4_3: make_db_h_4_3
	./make_db_h_4_3 > $@

23 24 25 26 27 28 29 30
sample_offsets:
sample_offsets_local: ./db.h
sample_offsets_local: sample_offsets.c
	$(CC) $(CFLAGS) -I. -DLOCAL $< -o $@
 
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
31

Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
32 33
clean:
	rm sample_offsets_mysql sample_offsets
34 35
install_4_1: db.h_4_1
	cp db.h_4_1 ../include/db.h
Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
36

Bradley C. Kuszmaul's avatar
Bradley C. Kuszmaul committed
37 38
# Note: To make the ompile work, you must cd to the ../../mysql-5.0.27/mysql-5.0.27/bdb/build_unix
# and do ../dist/configure