-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (72 loc) · 2.85 KB
/
Makefile
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
CC=g++
CFLAGS=-g3 -ggdb -O2 -Wshadow -Wall -Werror -Wunused -I/usr/local/torch/install/include/ -I/usr/local/torch/install/include/TH -I/usr/local/torch/install/include/THC -I/usr/local/torch/extra/cutorch/ -I/usr/local/cuda/include/ -I. -I../nn-gpu/ -I../matrix-gpu/ -fPIC
LIBS=-L/usr/local/cuda/lib64 -L/usr/local/torch/install/lib/lua/5.1/ -L/usr/local/torch/install/lib/ -lnppi -lnpps -Wl,-rpath=/usr/local/torch/install/lib/lua/5.1/ -lcutorch
LIB_SRCS=\
pipeline.C \
pipeline_impl.C \
imageutils_lua.C \
nnio_lua.C \
normalize_lua.C \
simpletest_lua.C \
tfidf_lua.C \
timehires_lua.C \
x21profile_lua.C \
LIB_OBJS=$(LIB_SRCS:C=o)
LEX_FILES=\
LEX_SRCS=$(LEX_FILES:l=C)
LEX_OBJS=$(LEX_SRCS:C=o)
PROTOS=\
PROTOS_DIRS=$(PROTOS:.protoc=)
PROTOS_CSOURCES=$(PROTOS:.protoc=.protoc.pb.C)
PROTOS_HEADERS=$(PROTOS:.protoc=.protoc.pb.h)
PROTOS_GENERATED=$(PROTOS_CSOURCES) $(PROTOS_HEADERS)
PROTOS_OBJS=$(PROTOS_CSOURCES:C=o)
MAIN_SRCS=\
MAIN_OBJS=$(MAIN_SRCS:C=o)
OBJS=$(LIB_OBJS) $(MAIN_OBJS) $(LEX_OBJS) $(PROTOS_OBJS)
CANDIDATES=$(filter %.d,$(patsubst %.C,%.d,$(patsubst %.c,%.d,$(LIB_SRCS) $(LEX_SRCS) $(MAIN_SRCS))))
DEPS=$(join $(dir $(CANDIDATES)),$(addprefix .,$(notdir $(CANDIDATES))))
BINS=\
imageutils.so \
nnio.so \
normalize.so \
pipeline.so \
simpletest.so \
tfidf.so \
timehires.so \
x21profile.so \
all: $(PROTOS_GENERATED) $(LEX_SRCS) $(OBJS) $(BINS)
test: all
/usr/local/torch/install/bin/th nnio_test.lua
push: checkin
/usr/bin/rsync -avz -e ssh --exclude=.*.sw? --exclude=.*.d --exclude=*.txt --exclude=*.txt.bz2 /home/binesh/src/torch7-libv2/ gpu.home.hex21.com:/home/binesh/src/torch7-libv2/
/usr/bin/rsync -avz -e ssh --exclude=.*.sw? --exclude=.*.d --exclude=*.txt --exclude=*.txt.bz2 /home/binesh/src/torch7-libv2/ som.hex21.com:/home/binesh/src/torch7-libv2/
checkin:
/usr/bin/ci -l -m- -t- Makefile $(MAIN_SRCS) $(LIB_SRCS) $(LEX_SRCS) *.[CH]
clean:
/bin/rm -f $(OBJS) $(BINS) $(LEX_SRCS) $(UGH_SRCS) $(UGH_HDRS) $(PROTOS_GENERATED) *.o $(DEPS)
imageutils.so: imageutils_lua.o
$(CC) -shared $(CFLAGS) -o $(@) $(^) $(LIBS)
pipeline.so: pipeline.o pipeline_impl.o
$(CC) -shared $(CFLAGS) -o $(@) $(^) $(LIBS)
nnio.so: nnio_lua.o
$(CC) -shared $(CFLAGS) -o $(@) $(^)
normalize.so: normalize_lua.o
$(CC) -shared $(CFLAGS) -o $(@) $(^)
simpletest.so: simpletest_lua.o
$(CC) -shared $(CFLAGS) -o $(@) $(^)
tfidf.so: tfidf_lua.o
$(CC) -shared $(CFLAGS) -o $(@) $(^)
timehires.so: timehires_lua.o
$(CC) -shared $(CFLAGS) -o $(@) $(^)
x21profile.so: x21profile_lua.o
$(CC) -shared $(CFLAGS) -o $(@) $(^)
%.o: %.C
$(CC) -c $(CFLAGS) $(filter-out /usr/local/include/%.C,$(filter %.C,$(^))) -o $(@)
%.C: %.l
/usr/bin/flex -s -o$(@) $(^)
.%.d: %.C
@$(CC) $(CFLAGS) -MT $(patsubst %.C,%.o,$(patsubst %.c,%.o,$(<))) -M $(<) -o $(@)
.%.d: %.c
@$(CC) $(CFLAGS) -MT $(patsubst %.C,%.o,$(patsubst %.c,%.o,$(<))) -M $(<) -o $(@)
-include $(DEPS)