-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (21 loc) · 812 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
CC=g++
INCLUDE_DIR := $(MNIST_ML_ROOT)/include
SRC := $(MNIST_ML_ROOT)/src
CFLAGS := -std=c++11 -g
LIB_DATA := libdata.so
all : $(LIB_DATA)
$(LIB_DATA) : libdir objdir obj/data_handler.o obj/data.o obj/common.o
$(CC) $(CFLAGS) -shared -o $(MNIST_ML_ROOT)/lib/$(LIB_DATA) obj/data_handler.o obj/data.o obj/common.o
libdir :
mkdir -p $(MNIST_ML_ROOT)/lib
objdir:
mkdir -p $(MNIST_ML_ROOT)/obj
obj/data_handler.o: $(SRC)/DataHandler.cc
$(CC) -fPIC $(CFLAGS) -o obj/data_handler.o -I$(INCLUDE_DIR)/*.h -c $(SRC)/DataHandler.cc
obj/data.o: $(SRC)/Data.cc
$(CC) -fPIC $(CFLAGS) -o obj/data.o -I$(INCLUDE_DIR)/*.h -c $(SRC)/Data.cc
obj/common.o: $(SRC)/Common.cc
$(CC) -fPIC $(CFLAGS) -o obj/common.o -I$(INCLUDE_DIR)/* -c $(SRC)/Common.cc
clean:
rm -r $(MNIST_ML_ROOT)/lib
rm -r $(MNIST_ML_ROOT)/obj