-
Notifications
You must be signed in to change notification settings - Fork 33
/
Makefile
42 lines (32 loc) · 1.31 KB
/
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
33
34
35
36
37
38
39
40
41
42
# This is a make file for OMCBoost package
# Amir Saffari, [email protected]
#-----------------------------------------
# Compiler options
CC = g++
INCLUDEPATH = -I/usr/local/include -I$(HOME)/local/include
LINKPATH = -L/usr/local/lib -L$(HOME)/local/lib
# OPTIMIZED
CFLAGS = -c -O3 -Wall -march=native -mtune=native -DNDEBUG -Wno-deprecated
LDFLAGS = -lconfig++
# Source directory and files
SOURCEDIR = src
HEADERS := $(wildcard $(SOURCEDIR)/*.h)
SOURCES := $(wildcard $(SOURCEDIR)/*.cpp)
OBJECTS := $(SOURCES:.cpp=.o)
LIBLARANKDIR := $(SOURCEDIR)/linear_larank
# Target output
BUILDTARGET = OMCBoost
# Build
all: $(BUILDTARGET)
$(BUILDTARGET): $(OBJECTS) $(SOURCES) $(HEADERS) $(LIBLARANKDIR)/LaRank.o $(LIBLARANKDIR)/vectors.o
$(CC) $(LINKPATH) $(LDFLAGS) $(OBJECTS) $(LIBLARANKDIR)/LaRank.o $(LIBLARANKDIR)/vectors.o -o $@
.cpp.o:
$(CC) $(CFLAGS) $(INCLUDEPATH) $< -o $@
$(LIBLARANKDIR)/LaRank.o: $(LIBLARANKDIR)/LaRank.cpp $(LIBLARANKDIR)/LaRank.h $(LIBLARANKDIR)/vectors.o
$(CC) $(CFLAGS) $(INCLUDEPATH) -o $(LIBLARANKDIR)/LaRank.o $(LIBLARANKDIR)/LaRank.cpp
$(LIBLARANKDIR)/vectors.o: $(LIBLARANKDIR)/vectors.h $(LIBLARANKDIR)/wrapper.h
$(CC) $(CFLAGS) $(INCLUDEPATH) -o $(LIBLARANKDIR)/vectors.o $(LIBLARANKDIR)/vectors.cpp
clean:
rm -f $(SOURCEDIR)/*~ $(SOURCEDIR)/*.o
rm -f $(LIBLARANKDIR)/*.o
rm -f $(BUILDTARGET)