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
|
#!/usr/bin/make -f
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_TARGET_MULTIARCH ?= $(shell dpkg-architecture -qDEB_TARGET_MULTIARCH)
CC=gcc
CFLAGS=-std=gnu99 -g -O2 -Wall -D TB_NO_THREADS -D TB_NO_HW_POP_COUNT -I.. $(CPPFLAGS)
%:
dh $@
override_dh_auto_build: fathom
override_dh_auto_install:
dh_auto_install
install -d debian/tmp/usr/lib/$(DEB_TARGET_MULTIARCH)
cp --reflink=auto -a ./lib*.so debian/tmp/usr/lib/$(DEB_TARGET_MULTIARCH)
cp --reflink=auto -a ./lib*.so.* debian/tmp/usr/lib/$(DEB_TARGET_MULTIARCH)
override_dh_makeshlibs:
dh_makeshlibs -- -v1.0 -plibfathom1
override_dh_clean:
rm -f *.o *.a *.so.* *.so fathom
dh_clean
fathom: fathom.o libfathom
$(CC) $(LDFLAGS) -L. $< -lfathom -o $@
fathom.o: src/apps/fathom.c
$(CC) $(CFLAGS) -I src -c $< -o $@
libfathom.a: tbprobe.o
ar rcs $@ $^
tbprobe.o: src/tbprobe.c src/tbprobe.h
$(CC) $(CFLAGS) -fPIC -I src -c -o $@ $<
libfathom: tbprobe.o libfathom.so.1 libfathom.so
$(CC) $(LDFLAGS) -shared tbprobe.o -Wl,-soname,libfathom.so.1 -o libfathom.so.1.0.0
libfathom.so.1:
ln -s libfathom.so.1.0.0 $@
libfathom.so:
ln -s libfathom.so.1.0.0 $@
|