Use dpkg-buildflags to build halog
authorApollon Oikonomopoulos <apoikos@gmail.com>
Tue, 2 Jul 2013 12:24:59 +0000 (15:24 +0300)
committerVincent Bernat <bernat@debian.org>
Thu, 14 Jan 2021 10:48:52 +0000 (10:48 +0000)
Forwarded: no
Last-Update: 2013-07-02

Gbp-Pq: Name 0002-Use-dpkg-buildflags-to-build-halog.patch

contrib/halog/Makefile

index bf67c1f13fa4056127dfac5c969471ec33332868..686a81c62798dfee3bf4d48f5db99f5719edaeb3 100644 (file)
@@ -1,22 +1,16 @@
 INCLUDE  = -I../../include
 SRC      = ../../src
 
-CC       = gcc
-
-# note: it is recommended to also add -fomit-frame-pointer on i386
-OPTIMIZE = -O3
+CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 
-# most recent glibc provide platform-specific optimizations that make
-# memchr faster than the generic C implementation (eg: SSE and prefetch
-# on x86_64). Try with an without. In general, on x86_64 it's better to
-# use memchr using the define below.
-# DEFINE   = -DUSE_MEMCHR
-DEFINE   =
+CC       = gcc
 
 OBJS     = halog
 
 halog: halog.c fgets2.c
-       $(CC) $(OPTIMIZE) $(DEFINE) -o $@ $(INCLUDE) $(SRC)/ebtree.c $(SRC)/eb32tree.c $(SRC)/eb64tree.c $(SRC)/ebmbtree.c $(SRC)/ebsttree.c $(SRC)/ebistree.c $(SRC)/ebimtree.c $^
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(INCLUDE) $(SRC)/ebtree.c $(SRC)/eb32tree.c $(SRC)/eb64tree.c $(SRC)/ebmbtree.c $(SRC)/ebsttree.c $(SRC)/ebistree.c $(SRC)/ebimtree.c $^
 
 clean:
        rm -f $(OBJS) *.[oas]