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 30 31 32 33 34 35 36 37 38 39 40 41 42
|
# get user and architecture specific options
OS := $(shell uname -s)
TORCHDIR := $(shell cd ..; pwd)
include ../Makefile_options_$(OS)
CC_FILES := $(wildcard *.cc)
OBJS := $(foreach f,$(CC_FILES),$(OBJS_DIR)/$(patsubst %.cc,%.o,$(f)))
all: $(LIBTORCH)
$(LIBTORCH): $(OBJS)
@echo "Archiving..."
@$(AR) $(LIBTORCH) $(OBJS)
$(OBJS_DIR)/%.o: %.cc
@echo $<
@$(CC) $(CFLAGS_$(MODE)) $(INCS) -o $@ -c $<
distclean:
@\rm -f .deps_*
clean:
@echo "Remove objects file and dependencies..."
@\rm -Rf $(OBJS) $(LIBTORCH)
@\rm -f .deps_$(VERSION_KEY)
depend:
@echo "Tracking dependencies..."
@\rm -f .deps_$(VERSION_KEY)
@for file in *.cc ; do printf "$(OBJS_DIR)/" >> .deps_$(VERSION_KEY); $(DEP) $(CFLAGS_$(MODE)) $(INCS) $$file >> .deps_$(VERSION_KEY); done
.deps_$(VERSION_KEY):
@echo ">>> Please do a 'make depend' <<<"
exit 10
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),depend)
include .deps_$(VERSION_KEY)
endif
endif
endif
|