-
Notifications
You must be signed in to change notification settings - Fork 56
/
Makefile
33 lines (26 loc) · 679 Bytes
/
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
TARGET = webcachesim
OBJS += caches/lru_variants.o
OBJS += caches/gd_variants.o
OBJS += random_helper.o
OBJS += webcachesim.o
LIBS += -lm
CXX = g++ #clang++ #OSX
CXXFLAGS += -std=c++11 #-stdlib=libc++ #non-linux
CXXFLAGS += -MMD -MP # dependency tracking flags
CXXFLAGS += -I./
CXXFLAGS += -Wall -Werror
LDFLAGS += $(LIBS)
all: CXXFLAGS += -O2 # release flags
all: $(TARGET)
debug: CXXFLAGS += -ggdb -D_GLIBCXX_DEBUG # debug flags
debug: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
%.o: %.c
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
DEPS = $(OBJS:%.o=%.d)
-include $(DEPS)
clean:
-rm $(TARGET) $(OBJS) $(DEPS)