File: Makefile

package info (click to toggle)
db1-compat 2.1.3-19
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 636 kB
  • sloc: ansic: 7,120; makefile: 60
file content (47 lines) | stat: -rw-r--r-- 1,553 bytes parent folder | download | duplicates (4)
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
# Makefile for 4.4BSD db code in GNU C library.
# This code is taken verbatim from the BSD db 1.85 package.  Only this
# Makefile and compat.h were written for GNU libc, and the header files
# moved up to this directory.

subdir = db

subdir-dirs = btree db hash mpool recno
vpath %.c $(subdir-dirs)

extra-libs := libdb1
extra-libs-others := $(extra-libs)
libdb1-routines := bt_close bt_conv bt_debug bt_delete bt_get \
		   bt_open bt_overflow bt_page bt_put bt_search \
		   bt_seq bt_split bt_utils \
		   db \
		   hash hash_bigkey hash_buf hash_func hash_log2 hash_page \
		   ndbm \
		   mpool \
		   rec_close rec_delete rec_get rec_open rec_put rec_search \
		   rec_seq rec_utils

CFLAGS ?= -O2
XCPPFLAGS = -I. -D_REENTRANT -D__DBINTERFACE_PRIVATE -DUSE_LIBDB1 -D_GNU_SOURCE
libdb.so-version=.2

all: libdb1.so$(libdb.so-version) db_dump185/db_dump185

%.o: %.c
	$(CC) $(XCPPFLAGS) $(CPPFLAGS) $(CFLAGS) -c -g -o $@ $<
%.os: %.c
	$(CC) $(XCPPFLAGS) $(CPPFLAGS) $(CFLAGS) -c -fPIC -o $@ $<

libdb1.so$(libdb.so-version): $(patsubst %,%.os,$(libdb1-routines))
	$(CC) -Wl,-O1 -Wl,--version-script=Versions -Wl,-z,combreloc \
	      -Wl,-soname=libdb.so$(libdb.so-version) $(LDFLAGS) \
	      -shared -o $@ $^ -lc

db_dump185/db_dump185: db_dump185/db_dump185.c libdb1.so$(libdb.so-version)
	$(CC) -I. $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
	      -o $@ $< libdb1.so$(libdb.so-version)

clean:
	rm -f $(patsubst %,%.o,$(libdb1-routines))
	rm -f $(patsubst %,%.os,$(libdb1-routines))
	rm -f libdb1.so$(libdb.so-version) *~
	rm -f db_dump185/db_dump185