2013-11-05 03:11:01 +08:00
|
|
|
CC=gcc
|
2013-12-07 05:26:09 +08:00
|
|
|
COMMON=-Wall `pkg-config --cflags opencv`
|
|
|
|
UNAME = $(shell uname)
|
|
|
|
ifeq ($(UNAME), Darwin)
|
2014-04-11 16:00:27 +08:00
|
|
|
COMMON+= -isystem /usr/local/Cellar/opencv/2.4.6.1/include/opencv -isystem /usr/local/Cellar/opencv/2.4.6.1/include
|
|
|
|
LDFLAGS= -framework OpenCL
|
2013-12-07 05:26:09 +08:00
|
|
|
else
|
2014-04-11 16:00:27 +08:00
|
|
|
COMMON+= -march=native -flto
|
|
|
|
LDFLAGS= -lOpenCL
|
2013-12-07 05:26:09 +08:00
|
|
|
endif
|
2014-03-13 12:57:34 +08:00
|
|
|
CFLAGS= $(COMMON) -Ofast
|
2013-12-03 08:41:40 +08:00
|
|
|
#CFLAGS= $(COMMON) -O0 -g
|
2014-04-11 16:00:27 +08:00
|
|
|
LDFLAGS+=`pkg-config --libs opencv` -lm
|
2013-11-05 03:11:01 +08:00
|
|
|
VPATH=./src/
|
2014-01-28 15:16:56 +08:00
|
|
|
EXEC=cnn
|
2013-11-05 03:11:01 +08:00
|
|
|
|
2014-04-11 16:00:27 +08: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 opencl.o gpu_gemm.o cpu_gemm.o
|
2013-11-05 03:11:01 +08:00
|
|
|
|
2014-01-28 15:16:56 +08:00
|
|
|
all: $(EXEC)
|
2013-11-05 03:11:01 +08:00
|
|
|
|
2014-01-28 15:16:56 +08:00
|
|
|
$(EXEC): $(OBJ)
|
2013-11-05 03:11:01 +08:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
2014-01-28 15:16:56 +08:00
|
|
|
rm -rf $(OBJ) $(EXEC)
|
2013-11-05 03:11:01 +08:00
|
|
|
|