| 1 |
|
| •2 |
CFLAGS += -std=gnu99 |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
BENCH_CFLAGS := -O3 -ffast-math -funroll-loops |
| 7 |
|
| 8 |
CFLAGS += ${OPT_CFLAGS} |
| 9 |
override CFLAGS += -I. |
| 10 |
|
| 11 |
|
| 12 |
THREAD_SUPPORT := $(shell if $(CC) $(CFLAGS) threadtest.c -o threadtest \ |
| 13 |
>/dev/null 2>/dev/null ; then echo "yes" ; else echo "no"; fi) |
| 14 |
ifeq ($(THREAD_SUPPORT),no) |
| 15 |
override CFLAGS += -D__thread="" |
| 16 |
endif |
| 17 |
|
| 18 |
|
| 19 |
THREAD_SUPPORT := $(shell touch empty.c ; if $(CC) $(CFLAGS) -c -ftree-vectorize empty.c -o empty.o \ |
| 20 |
>/dev/null 2>/dev/null ; then echo "yes" ; else echo "no"; fi) |
| 21 |
ifeq ($(THREAD_SUPPORT),yes) |
| 22 |
BENCH_CFLAGS += -ftree-vectorize |
| 23 |
endif |
| 24 |
|
| 25 |
CLEANFILES := numad.o numad .depend .depend.X empty.c empty.o |
| 26 |
|
| 27 |
SOURCES := numad.c |
| 28 |
|
| •29 |
prefix := $(DESTDIR)/usr |
| 30 |
docdir := ${prefix}/share/doc |
| 31 |
|
| 32 |
all: numad |
| 33 |
|
| 34 |
LDLIBS := -lpthread -lrt -lm |
| 35 |
numad: numad.o |
| 36 |
|
| 37 |
AR ?= ar |
| 38 |
RANLIB ?= ranlib |
| 39 |
|
| 40 |
.PHONY: install all clean html depend |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
install: numad |
| 45 |
mkdir -p ${prefix}/bin |
| 46 |
mkdir -p ${prefix}/share/man/man8 |
| 47 |
install -m 0755 numad ${prefix}/bin |
| 48 |
install -m 0644 numad.8 ${prefix}/share/man/man8 |
| 49 |
|
| 50 |
clean: |
| 51 |
rm -f ${CLEANFILES} |
| 52 |
@rm -rf html |
| 53 |
|
| 54 |
distclean: clean |
| •55 |
#rm -f .[^.]* */.[^.]* |
| 56 |
rm -f *~ */*~ *.orig */*.orig */*.rej *.rej |
| 57 |
|
| 58 |
depend: .depend |
| 59 |
|
| 60 |
.depend: |
| 61 |
${CC} -MM -DDEPS_RUN -I. ${SOURCES} > .depend.X && mv .depend.X .depend |
| 62 |
|
| 63 |
include .depend |
| 64 |
|
| 65 |
Makefile: .depend |
| 66 |
|