-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
50 lines (38 loc) · 1.07 KB
/
makefile
File metadata and controls
50 lines (38 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.PHONY : clean doc build examples
SRCDIR = src
INCDIR = includes
BUILDDIR = build
SOURCES = $(shell echo $(SRCDIR)/*.cpp)
HEADERS = $(shell echo $(INCDIR)/*.h $(INCDIR)/*.hpp)
OBJECTS = $(SOURCES:.cpp=.o)
LIBNAME = libENN
TARGET = $(BUILDDIR)/$(LIBNAME).so
COMPILER= g++
CPPFLAGS= -I$(INCDIR) -std=c++11 -fPIC -g -Wall -O3 -fopenmp
LDFLAGS = -shared
all: reset build clean
reset :
@reset
@echo '**************************'
@echo '**** Compiling ENNlib ****'
@echo '**************************'
build: $(TARGET)
$(TARGET): $(OBJECTS)
@echo "[Info] Compiling library"
@$(COMPILER) $(CPPFLAGS) $(OBJECTS) -o $@ $(LDFLAGS)
@echo "[Info] Library compiled"
%.o : %.cpp
@echo '[Info] (Compiling '$<')'
@$(COMPILER) $< $(CPPFLAGS) -c -o $(basename $<).o
clean:
@echo "[Info] Cleaning object files"
@rm -f $(OBJECTS)
doc:
@echo "[Info] Generating documentation"
@doxygen Doxyfile
@echo "[Info] Documentation generated"
examples:
@echo '****************************'
@echo '**** Compiling examples ****'
@echo '****************************'
@$(MAKE) -C ./examples examples