-
Notifications
You must be signed in to change notification settings - Fork 10
/
GNUmakefile.in
80 lines (63 loc) · 1.93 KB
/
GNUmakefile.in
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
Q := @
CC := g++ -std=gnu++0x
DEPSDIR := .deps
DEPCFLAGS = -MD -MF $(DEPSDIR)/$*.d -MP
TOP := $(shell echo $${PWD-'pwd'})
MAXCPUS := $(shell grep -c processor /proc/cpuinfo)
O := obj
OPTFLAGS := -g @OPT_LEVEL@ -fno-omit-frame-pointer
CFLAGS := -D_GNU_SOURCE -Wall $(OPTFLAGS) -include config.h \
-I$(TOP) -I$(TOP)/lib -DJTLS=__thread -DJSHARED_ATTR= \
-DJOS_CLINE=64 -DCACHE_LINE_SIZE=64 \
-DJOS_NCPU=$(MAXCPUS) -D__STDC_FORMAT_MACROS
LIB := -L$(O) -lmetis -ldl @MEM_ALLOCATOR@ -lc -lm -lpthread -ldl
LDEPS := $(O)/libmetis.a
PROGS := obj/kmeans \
obj/matrix_mult \
obj/pca \
obj/wc \
obj/wr \
obj/linear_regression \
obj/hist \
obj/string_match \
obj/wrmem \
obj/matrix_mult2 \
obj/sf_sample \
obj/btree_unit \
obj/search_unit \
obj/misc \
obj/minmaponly
all: $(PROGS)
include lib/Makefrag
$(O)/%: $(O)/%.o $(LDEPS) $(DEPSDIR)/stamp
@echo "MAKE $@"
$(Q)$(CC) $(DEPCFLAGS) $(CFLAGS) -o $@ $< $(LIB)
$(O)/%.o: app/%.cc $(DEPSDIR)/stamp
$(Q)mkdir -p $(@D)
@echo "CC $<"
$(Q)$(CC) $(DEPCFLAGS) $(CFLAGS) -o $@ -c $<
$(O)/%.o: micro/%.cc $(DEPSDIR)/stamp
$(Q)mkdir -p $(@D)
$(Q)$(CC) $(DEPCFLAGS) $(CFLAGS) -o $@ -c $<
$(DEPSDIR)/stamp:
@echo "MAKE $@"
@mkdir -p $(@D)
@touch $@
DTOP = ./data
sanity_data:
mkdir -p $(DTOP)
dd if=/dev/urandom of=$(DTOP)/lr_10MB.txt count=1024 bs=10240
data_gen:
cd data_tool && g++ gen.cc -o gen
bash data_tool/data-gen.sh
data_clean:
rm data_tool/gen $(DTOP)/wr/800MB.txt $(DTOP)/wr/500MB.txt $(DTOP)/hist-2.6g.bmp -rf
rm $(DTOP)/lr_4GB.txt $(DTOP)/lr_10MB.txt $(DTOP)/sm_1GB.txt $(DTOP)/*~ -rf
clean:
@rm -rf $(PROGS) *.o *.a *~ *.tmp *.bak *.log *.orig $(O) $(DEPSDIR)
.PRECIOUS: $(O)/%.o
DEPFILES := $(wildcard $(DEPSDIR)/*.d)
ifneq ($(DEPFILES),)
include $(DEPFILES)
endif
.PHONY: default clean