Skip to content

Commit a143576

Browse files
Added conditional compilation flags
1 parent 35a2143 commit a143576

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: Makefile

+11-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ INCLUDE = -I$(PWD)/include
1010
# Libraries
1111
LIBS = -DARMA_DONT_USE_WRAPPER -L$(PWD) -lxatu -larmadillo -lopenblas -llapack -larpack -fopenmp -lgfortran
1212

13+
# Conditional flags for compilation
14+
ifeq ($(DEBUG), 1)
15+
CFLAGS = -Wall -lm -g
16+
FFLAGS = -Wall -Wno-tabs -lm -g
17+
endif
18+
ifeq ($(HDF5), 1)
19+
CFLAGS += -DARMA_USE_HDF5
20+
LIBS += -lhdf5
21+
endif
22+
1323
# Compilation targets
1424
CC_SRC_FILES := $(wildcard src/*.cpp)
1525
OBJECTS := $(patsubst src/%.cpp, build/%.o, $(CC_SRC_FILES))
@@ -22,7 +32,7 @@ dummy_build_folder := $(shell mkdir -p build)
2232
dummy_bin_folder := $(shell mkdir -p bin)
2333

2434
build: $(OBJECTS)
25-
ar rcs libxatu.a $(OBJECTS)
35+
ar rcs libxatu.a $(OBJECTS)
2636

2737
xatu: main/xatu.cpp $(OBJECTS)
2838
$(CC) -o bin/$@ $< $(CFLAGS) $(INCLUDE) $(LIBS)

0 commit comments

Comments
 (0)