Makefile 637 字节
Newer Older
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
include ../../Makefile

MACHINE := $(shell $(MGB_CXX) -dumpmachine)

ifneq (, $(findstring android, $(MACHINE)))
    DEPS := $(MGB_LIB) ${MEGDNN_LIB}
    CXXFLAGS := $(MGB_CXXFLAGS) -fuse-ld=gold -Isrc
    LDFLAGS := -ldl -llog ${DEPS}
else
    DEPS := $(MGB_LIB) ${MEGDNN_LIB}
    CXXFLAGS := $(MGB_CXXFLAGS) -fuse-ld=gold -Isrc
    LDFLAGS := -ldl ${DEPS} ${MGB_LDFLAGS}
endif

TARGETS := load_and_run

all: $(TARGETS)

ifneq (,$(findstring gcov,$(MGB_LDFLAGS)))
	LDFLAGS += --coverage
endif

load_and_run: main.cpp src/* $(DEPS)
	$(MGB_CXX) -o $@ main.cpp src/*.cpp $(CXXFLAGS) $(LDFLAGS)

clean:
	rm -f $(TARGETS)

.PHONY: all clean