-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (44 loc) · 1.64 KB
/
Makefile
File metadata and controls
60 lines (44 loc) · 1.64 KB
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
#
# Important! Dependencies are done automatically by 'make dep', which also
# removes any old dependencies. Do not modify it...
#
# 2022, d3phys
#
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
# Header files #
HPATH = $(TOPDIR)/include \
$(TOPDIR)/ht \
$(TOPDIR)/io \
$(TOPDIR)/logs \
$(TOPDIR)/list/include
ifeq ($(MAKELEVEL),0)
CXX = g++
CXXFLAGS = $(addprefix -I, $(HPATH)) $(LOGSFLAGS) -mavx2 -O2 -D NDEBUG #$(TXFLAGS)
LOGSFLAGS = -D LOGS_COLORS -D LOGS_FILE='"logs.html"' # -D LOGS_DEBUG
endif
# Subdirectories #
SUBDIRS = logs list ht io init crc32
htab.o: list.o ht.o io.o
$(LD) -r -o htab.o list/list.o ht/ht.o io/io.o
anal: list.o ht.o io.o logs.o
$(CXX) $(CXXFLAGS) -c -o init/init.o init/anal.cpp
$(CXX) $(CXXFLAGS) -o anal init/init.o list/list.o logs/logs.o ht/ht.o io/io.o
./anal
perf: list.o ht.o io.o logs.o crc32.o
$(CXX) $(CXXFLAGS) -c -o init/init.o init/perf.cpp
$(CXX) $(CXXFLAGS) -o perf init/init.o list/list.o logs/logs.o ht/ht.o io/io.o crc32/crc32.o
cache:
perf stat -e instructions,L1-dcache-loads,L1-dcache-load-misses \
-e page-faults,branch-instructions,branch-misses,alignment-faults \
./perf text out
perf record -e instructions,L1-dcache-loads,L1-dcache-load-misses \
-e page-faults,branch-instructions,branch-misses,alignment-faults \
./perf text out
common:
perf stat ./perf text out
perf record ./perf text out
%.o:
cd $(patsubst %.o,%, $@) && $(MAKE)
.EXPORT_ALL_VARIABLES: CXX CXXFLAGS CPP LOGS
include $(TOPDIR)/Rules.makefile
### Dependencies ###