-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
32 lines (26 loc) · 1011 Bytes
/
Makefile
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
# © All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE,
# Switzerland, Laboratory of Experimental Biophysics, 2017
# See the LICENSE.txt file for more details.
CC := g++
SRCDIR := PolymerCpp/core
BUILDDIR := build
TARGETDIR := lib
TARGET := $(TARGETDIR)/PolymerCppCore.so
SRCEXT := cpp
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
CFLAGS := -std=c++11 -O2 -fPIC
LIB := $(shell python-config --ldflags) -fopenmp
INC := -I include/ $(shell python-config --cflags)
$(TARGET): $(OBJECTS)
@mkdir -p $(TARGETDIR)
@echo " Linking..."
@echo " $(CC) -shared $^ -o $(TARGET) $(LIB)"; $(CC) -shared $^ -o $(TARGET) $(LIB)
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
@mkdir -p $(BUILDDIR)
@echo $(LIB)
@echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $< $(LIB)"; $(CC) $(CFLAGS) $(INC) -c -o $@ $< $(LIB)
clean:
@echo " Cleaning...";
@echo " $(RM) -r $(BUILDDIR) $(TARGET)"; $(RM) -r $(BUILDDIR) $(TARGET)
.PHONY: clean