POPCOUNT=$(shell grep -q popcnt /proc/cpuinfo && echo 1) ifeq ($(POPCOUNT), 1) POPCOUNT_FLAG=-DHAS_NATIVE_POPCOUNT -mpopcnt else #POPCOUNT_FLAG=-DHAS_POPCOUNT_TABLE POPCOUNT_FLAG= endif ifeq ($(VERBOSE), true) HIDE= else HIDE=@ endif ifeq ($(DEBUG), true) OPT_FLAGS=-O0 -g $(POPCOUNT_FLAG) -static else OPT_FLAGS=-O3 $(POPCOUNT_FLAG) -static endif ifeq ($(PROFILE), true) PROF_FLAGS=-pg -g else PROF_FLAGS= endif INC_FLAGS=-I. CFLAGS= $(INC_FLAGS) $(OPT_FLAGS) $(PROF_FLAGS) CXXFLAGS= $(INC_FLAGS) $(OPT_FLAGS) $(PROF_FLAGS) CC=g++ OBJECTS_BP=bp.o bp-utils.o bp-darray.o bp-core.o LIB_BP=libbp.a all: depend $(LIB_BP) $(LIB_BP): $(OBJECTS_BP) @echo [Link] $@ $(HIDE) ar rcs $@ $(OBJECTS_BP) %o: %c @echo [C] $@ $(HIDE) $(CC) -c $(CFLAGS) $< -o $@ %o: %cpp @echo [C++] $@ $(HIDE) $(CC) -c $(CXXFLAGS) $< -o $@ depend: @echo [DEPEND] $(HIDE) (gcc -MM *.c) > $@ clean: @echo [CLEAN] $(HIDE) rm -f *.[ao] depend -include depend