File: Makefile.modules

package info (click to toggle)
torch3 3.1-2.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 2,972 kB
  • ctags: 2,743
  • sloc: cpp: 24,245; python: 299; makefile: 153
file content (55 lines) | stat: -rw-r--r-- 1,465 bytes parent folder | download | duplicates (3)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
# get user and architecture specific options
OS := $(shell uname -s | tr '/' '_')
TORCHDIR := $(shell cd ..; pwd)
include ../Makefile_options_$(OS)

CC_FILES := $(wildcard *.cc)
STATICOBJSDIR := $(OBJS_DIR)/static
STATICOBJS := $(foreach f,$(CC_FILES),$(OBJS_DIR)/static/$(patsubst %.cc,%.o,$(f)))
DYNAMICOBJS := $(foreach f,$(CC_FILES),$(OBJS_DIR)/dynamic/$(patsubst %.cc,%.o,$(f)))
DYNAMICOBJSDIR := $(OBJS_DIR)/dynamic

all:	$(LIBTORCH) $(LIBSOTORCH)
soname: $(LIBSOTORCH)

$(LIBTORCH): $(STATICOBJS)
	@echo "Archiving..."
	$(AR) $(LIBTORCH) $(STATICOBJSDIR)/*.o
$(LIBSOTORCH): $(DYNAMICOBJS)
	$(CC) -shared -Wl,-soname=libtorch.so.3 -o $(LIBSOTORCH) $(DYNAMICOBJSDIR)/*.o
	

$(OBJS_DIR)/static/%.o: %.cc
	@echo $<
	$(CC) $(CFLAGS_$(MODE)) $(INCS) -o $@ -c $<
$(OBJS_DIR)/dynamic/%.o: %.cc
	@echo $<
	$(CC) -fPIC $(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)
	rm -f *.class

depend:
	@echo "Tracking dependencies..."
	rm -f .deps_$(VERSION_KEY)
	echo ${CURDIR}
	echo *.cc
	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