--- /tmp/GNUmakefile 2017-02-13 11:43:57.882750000 -0800 +++ GNUmakefile 2017-02-13 11:56:19.109139000 -0800 @@ -1,24 +1,22 @@ -#DEBUG=1 -ZLIB=1 -prefix=/opt/diet +prefix=${PREFIX} BINDIR=${prefix}/bin MANDIR=${prefix}/man man1dir=$(MANDIR)/man1 -TARGETS=gatling httpbench bindbench dl ioerr bench tlsgatling_nofail \ -pthreadbench cgi ptlsgatling_nofail -TARGETS2=mktestdata mmapbench manymapbench forkbench forksbench +TARGETS=gatling dl cgi +TARGETS2= +ifdef BENCHMARKS +TARGETS+=httpbench bindbench ioerr bench pthreadbench +TARGETS2+=mktestdata mmapbench manymapbench forkbench forksbench +endif +ifdef TLSGATLING +TARGETS+=tlsgatling +endif ALLTARGETS=$(TARGETS) acc hcat referrer hitprofile matchiprange getlinks \ rellink $(TARGETS2) all: $(ALLTARGETS) -CROSS= -#CROSS=i686-mingw32- -CC=$(CROSS)gcc -CFLAGS=-pipe -Wall -LDFLAGS= - #CFLAGS+=-DSTATE_DEBUG -DMOREDEBUG -DDEBUG_EVENTS -DSMDEBUG path = $(subst :, ,$(PATH)) @@ -36,15 +34,11 @@ # to build without diet libc support, use $ make DIET= # see http://www.fefe.de/dietlibc/ for details about the diet libc +DIET= + ifneq ($(DEBUG),) CFLAGS+=-g -Og LDFLAGS+=-g -else -CFLAGS+=-O2 -fomit-frame-pointer -I/usr/local/include -LDFLAGS+=-s -ifneq ($(DIET),) -DIET+=-Os -endif endif LDLIBS=-lowfat @@ -136,11 +130,13 @@ rm -f trysocket libiconv: tryiconv.c - if $(CC) $(CFLAGS) -o tryiconv tryiconv.c >/dev/null 2>&1; then echo ""; else \ - if $(CC) $(CFLAGS) -o tryiconv tryiconv.c -liconv >/dev/null 2>&1; then echo "-liconv"; else \ - if $(CC) $(CFLAGS) -o tryiconv tryiconv.c -L/usr/local/lib -liconv >/dev/null 2>&1; then \ - echo "-L/usr/local/lib -liconv"; \ - fi; fi; fi > libiconv +ifdef ICONV + if $(CC) $(CFLAGS) $(LDFLAGS) -o tryiconv tryiconv.c -liconv >/dev/null 2>&1; then echo "-L$(LDFLAGS) -liconv"; else \ + echo ""; \ + fi > libiconv +else + echo "" > libiconv +endif rm -f tryiconv libcrypt: trycrypt.c