-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (30 loc) · 930 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
34
35
36
37
38
39
40
41
42
PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
CC=gcc
CXX=g++
INCLUDE += \
-I$(PROJECT_ROOT)/include
BUILDDIR = build
BUILDDIR_APP = $(BUILDDIR)/app
BUILDDIR_LIB = $(BUILDDIR)/lib
OUTPUT_DIR = output
BUILDDIR_LIB_OBJS = \
$(BUILDDIR_LIB)/CRTCBoundData.o \
$(BUILDDIR_LIB)/CCensusFileManager.o
CFLAGS += -g -lpq
CXXFLAGS += -DDEBUG -g
LIBS += \
$(OUTPUT_DIR)/lib_census_file_manager.a
$(BUILDDIR_APP)/%.o: $(PROJECT_ROOT)/src/app/%.cpp
$(CXX) -c $(CFLAGS) $(CXXFLAGS) --std=c++11 $(CPPFLAGS) $(INCLUDE) -o $@ $<
$(BUILDDIR_LIB)/%.o: $(PROJECT_ROOT)/src/lib/%.cpp
$(CXX) -c $(CFLAGS) $(CXXFLAGS) --std=c++11 $(CPPFLAGS) $(INCLUDE) -o $@ $<
all: tree libs
tree:
@mkdir -p $(BUILDDIR_APP)
@mkdir -p $(BUILDDIR_LIB)
@mkdir -p $(OUTPUT_DIR)
libs: $(LIBS)
$(OUTPUT_DIR)/lib_census_file_manager.a : $(BUILDDIR_LIB_OBJS)
$(AR) rcs $@ $(BUILDDIR_LIB_OBJS)
clean:
rm -fr $(BUILDDIR) $(OUTPUT_DIR)