-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.base
54 lines (45 loc) · 1.24 KB
/
Makefile.base
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
NAME=c_plus_plus_serializer
OBJDIR=.o
TARGET_OBJECTS=\
$(OBJDIR)/main.o \
$(OBJDIR)/basic_example.o \
$(OBJDIR)/bitfields_in_class_example.o \
$(OBJDIR)/container_example.o \
$(OBJDIR)/custom_class_example.o \
$(OBJDIR)/deque_example.o \
$(OBJDIR)/hexdump.o \
$(OBJDIR)/map_custom_class_example.o \
$(OBJDIR)/map_example.o \
$(OBJDIR)/map_string_to_list_of_strings_example.o \
$(OBJDIR)/multiset_example.o \
$(OBJDIR)/quicklz.o \
$(OBJDIR)/raw_memory.o \
$(OBJDIR)/set_example.o \
$(OBJDIR)/template_class_example.o \
$(OBJDIR)/unordered_map_example.o \
$(OBJDIR)/zipped_container_example.o \
EXTRA_CFLAGS=-std=c++11
#EXTRA_CFLAGS+=-DDEBUG_C_PLUS_PLUS_SERIALIZER
#EXTRA_CFLAGS+=-DUSE_SIZE_T
$(OBJDIR)/%.o: examples/%.cpp
$(shell echo clang-format -i $<)
@echo $(CXX) $(EXTRA_CFLAGS) $(CFLAGS) -c -o $@ $<
@$(CXX) $(EXTRA_CFLAGS) $(CFLAGS) -c -o $@ $<
#
# link
#
TARGET=$(NAME)$(EXE)
$(TARGET): $(TARGET_OBJECTS)
$(CXX) $(TARGET_OBJECTS) $(LDLIBS) -o $(TARGET)
#
# To force clean and avoid "up to date" warning.
#
.PHONY: clean
.PHONY: clobber
clean:
rm -rf $(TARGET) $(OBJDIR)/*.o
clobber: clean
mkdir -p $(OBJDIR)
all: $(TARGET)
format:
git diff -U0 HEAD^ | clang-format-diff -i -p1