Skip to content

Commit

Permalink
Update to use scheme.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu committed Dec 18, 2016
1 parent 517e78d commit 733aff9
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 134 deletions.
12 changes: 2 additions & 10 deletions bin/cuda/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ LDFLAGS := -L"../../lib" -lccv $(LDFLAGS)
CFLAGS := -O3 -Wall -I"../../lib" $(CFLAGS)
NVFLAGS := -O3 -I"../../lib" -lineinfo $(NVFLAGS)

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PHONY: release debug all clean
.PHONY: release all clean

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../lib/scheme.mk

all: libccv.a cwc-forwards cwc-backwards cwc-bench cwc-verify

Expand Down
12 changes: 2 additions & 10 deletions bin/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,11 @@ TARGETS = bbffmt msermatch siftmatch bbfcreate bbfdetect scdcreate scddetect swt

TARGET_SRCS := $(patsubst %,%.c,$(TARGETS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PHONY: release debug all clean dep
.PHONY: release all clean dep

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../lib/scheme.mk

all: libccv.a $(TARGETS) .gitignore

Expand Down
12 changes: 2 additions & 10 deletions bin/nnc/cudnn/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ TARGETS = conv-cudnn-forw conv-cudnn-back

TARGET_SRCS := $(patsubst %,%.c,$(TARGETS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PHONY: release debug all clean dep
.PHONY: release all clean dep

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../../lib/scheme.mk

all: $(TARGETS)

Expand Down
12 changes: 2 additions & 10 deletions bin/nnc/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ TARGETS = nnc-e2e-verify nnc-e2e-sym-verify nnc-sym

TARGET_SRCS := $(patsubst %,%.c,$(TARGETS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PHONY: release debug all clean dep
.PHONY: release all clean dep

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../lib/scheme.mk

all: $(TARGETS)

Expand Down
12 changes: 2 additions & 10 deletions bin/nnc/opt/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ TARGETS = auto-tune-conv auto-tune-gemm conv-4x4-3x3-winograd conv-gemm conv-opt

TARGET_SRCS := $(patsubst %,%.c,$(TARGETS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PHONY: release debug all clean dep
.PHONY: release all clean dep

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../../lib/scheme.mk

all: $(TARGETS)

Expand Down
11 changes: 2 additions & 9 deletions lib/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ SRC_OBJS := $(patsubst %.c,%.o,$(SRCS))

CUDA_OBJS := $(patsubst %.c,%.o,$(patsubst %.cu,%.o,$(CUDA_SRCS)))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

# Make nnc/libnnc.o a phony target therefore it will be triggered every time.
.PHONY: release debug all lib clean dep nnc/libnnc.o
.PHONY: release all lib clean dep nnc/libnnc.o

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include scheme.mk

all: lib ../samples/image-net-2012-vgg-d.sqlite3

Expand Down
11 changes: 2 additions & 9 deletions lib/nnc/cmd/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ CUDA_CMD_OBJS := $(patsubst %.c,%.o,$(patsubst %.cu,%.o,$(CUDA_CMD_SRCS)))
CFLAGS := -O3 -Wall -I"../../" $(CFLAGS)
NVFLAGS := -O3 -I"../../" $(NVFLAGS)

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PHONY: release debug all lib clean cmd libnnc-cmd.o $(CUDA_CMD_LIB)
.PHONY: release all lib clean cmd libnnc-cmd.o $(CUDA_CMD_LIB)

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../scheme.mk

all: lib

Expand Down
11 changes: 2 additions & 9 deletions lib/nnc/gpu/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ SRCS := ccv_nnc_compat.cu

SRC_OBJS := $(patsubst %.c,%.o,$(patsubst %.cu,%.o,$(SRCS)))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PHONY: release debug all lib clean libnnc-compat-cuda.o
.PHONY: release all lib clean libnnc-compat-cuda.o

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../scheme.mk

all: lib

Expand Down
11 changes: 2 additions & 9 deletions lib/nnc/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ SRCS := ccv_nnc_cmd.c ccv_nnc_tensor.c ccv_nnc_graph.c ccv_nnc_symbolic_graph.c

SRC_OBJS := $(patsubst %.c,%.o,$(SRCS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PHONY: release debug all lib clean cmd libnnc.o cmd/libnnc-cmd.o gpu/libnnc-compat-cuda.o
.PHONY: release all lib clean cmd libnnc.o cmd/libnnc-cmd.o gpu/libnnc-compat-cuda.o

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../scheme.mk

all: lib

Expand Down
14 changes: 14 additions & 0 deletions lib/scheme.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.PHONY: debug

# Debug Scheme

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
11 changes: 2 additions & 9 deletions serve/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,11 @@ SRCS = serve.c uri.c parsers.c bbf.c dpm.c icf.c scd.c sift.c swt.c tld.c convne

SRC_OBJS := $(patsubst %.c,%.o,$(SRCS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address
endif

.PHONY: release debug all clean dep
.PHONY: release all clean dep

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address
debug: export DEBUG = 1
debug: all
include ../lib/scheme.mk

all: libccv.a $(TARGETS)

Expand Down
10 changes: 1 addition & 9 deletions site/_source/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@ TARGETS = section-001-001 section-001-002

TARGET_SRCS := $(patsubst %,%.c,$(TARGETS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address
endif

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address
debug: export DEBUG = 1
debug: all
include ../../lib/scheme.mk

all: libccv.a $(TARGETS)

Expand Down
12 changes: 2 additions & 10 deletions test/regression/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ TARGETS = defects.l0.1.tests

TARGET_SRCS := $(patsubst %,%.c,$(TARGETS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PRECIOUS: $(patsubst %,%.o,$(TARGETS))

.PHONY: release debug all test clean dep
.PHONY: release all test clean dep

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../lib/scheme.mk

all: $(TARGETS)

Expand Down
12 changes: 2 additions & 10 deletions test/unit/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ TARGETS = algebra.tests util.tests numeric.tests basic.tests image_processing.te

TARGET_SRCS := $(patsubst %,%.c,$(TARGETS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PRECIOUS: $(patsubst %,%.o,$(TARGETS))

.PHONY: release debug all test clean dep
.PHONY: release all test clean dep

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../lib/scheme.mk

all: $(TARGETS)

Expand Down
12 changes: 2 additions & 10 deletions test/unit/nnc/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ TARGETS = tfb.tests tensor.tests forward.tests backward.tests gradient.tests gra

TARGET_SRCS := $(patsubst %,%.c,$(TARGETS))

DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
endif

.PRECIOUS: $(patsubst %,%.o,$(TARGETS))

.PHONY: release debug all test clean dep
.PHONY: release all test clean dep

release: all

debug: CFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: LDFLAGS += -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined
debug: export DEBUG = 1
debug: all
include ../../../lib/scheme.mk

all: $(TARGETS)

Expand Down

0 comments on commit 733aff9

Please sign in to comment.