2013-11-04 23:11:01 +04:00
|
|
|
CC=gcc
|
2014-05-01 03:17:40 +04:00
|
|
|
GPU=1
|
2014-05-03 02:20:34 +04:00
|
|
|
COMMON=-Wall -Werror -Wfatal-errors `pkg-config --cflags opencv` -I/usr/local/cuda/include/
|
|
|
|
ifeq ($(GPU), 1)
|
|
|
|
COMMON+=-DGPU
|
|
|
|
else
|
|
|
|
endif
|
2013-12-07 01:26:09 +04:00
|
|
|
UNAME = $(shell uname)
|
2014-05-03 02:20:34 +04:00
|
|
|
OPTS=-O3 -flto
|
2013-12-07 01:26:09 +04:00
|
|
|
ifeq ($(UNAME), Darwin)
|
2014-04-11 12:00:27 +04:00
|
|
|
COMMON+= -isystem /usr/local/Cellar/opencv/2.4.6.1/include/opencv -isystem /usr/local/Cellar/opencv/2.4.6.1/include
|
2014-04-20 00:10:59 +04:00
|
|
|
ifeq ($(GPU), 1)
|
2014-04-11 12:00:27 +04:00
|
|
|
LDFLAGS= -framework OpenCL
|
2014-04-20 00:10:59 +04:00
|
|
|
endif
|
2013-12-07 01:26:09 +04:00
|
|
|
else
|
2014-04-20 00:10:59 +04:00
|
|
|
ifeq ($(GPU), 1)
|
2014-04-11 12:00:27 +04:00
|
|
|
LDFLAGS= -lOpenCL
|
2013-12-07 01:26:09 +04:00
|
|
|
endif
|
2014-04-20 00:10:59 +04:00
|
|
|
endif
|
2014-04-17 04:05:29 +04:00
|
|
|
CFLAGS= $(COMMON) $(OPTS)
|
2014-05-03 02:20:34 +04:00
|
|
|
#CFLAGS= $(COMMON) -O0 -g
|
2014-04-11 12:00:27 +04:00
|
|
|
LDFLAGS+=`pkg-config --libs opencv` -lm
|
2013-11-04 23:11:01 +04:00
|
|
|
VPATH=./src/
|
2014-01-28 11:16:56 +04:00
|
|
|
EXEC=cnn
|
2013-11-04 23:11:01 +04:00
|
|
|
|
2014-05-03 02:20:34 +04:00
|
|
|
OBJ=network.o image.o tests.o connected_layer.o maxpool_layer.o activations.o list.o option_list.o parser.o utils.o data.o matrix.o softmax_layer.o mini_blas.o convolutional_layer.o gemm.o normalization_layer.o opencl.o im2col.o col2im.o axpy.o
|
2013-11-04 23:11:01 +04:00
|
|
|
|
2014-01-28 11:16:56 +04:00
|
|
|
all: $(EXEC)
|
2013-11-04 23:11:01 +04:00
|
|
|
|
2014-01-28 11:16:56 +04:00
|
|
|
$(EXEC): $(OBJ)
|
2013-11-04 23:11:01 +04:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
2014-01-28 11:16:56 +04:00
|
|
|
rm -rf $(OBJ) $(EXEC)
|
2013-11-04 23:11:01 +04:00
|
|
|
|