-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
35 lines (26 loc) · 964 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
TARGETS=stata_readwrite stata_readwrite_test
CC=g++
CFLAGS=
DEBUG=-g
LDFLAGS=-lboost_system -lboost_program_options -lboost_unit_test_framework -lsqlite3
SOURCES=main.cpp StataHeader.cpp StataMap.cpp StataVariables.cpp StataValueLabel.cpp State.cpp StateBitops.cpp SQLite.cpp
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=stata_readwrite
SOURCES_TEST = $(filter-out main.cpp, $(SOURCES))
SOURCES_TEST += StataTest.cpp
OBJECTS_TEST=$(SOURCES_TEST:.c=.o)
EXECUTABLE_TEST = stata_readwrite_test
all: $(TARGETS)
$(EXECUTABLE): $(OBJECTS)
@echo 'Building target: $@. First dep: $<'
${CC} -o $(EXECUTABLE) $(OBJECTS) $(LDFLAGS) $(DEBUG)
.c.o:
@echo 'Building target: $@. First dep: $<'
$(CC) $(CFLAGS) $< -o $@
test: $(SOURCES_TEST) $(EXECUTABLE_TEST)
$(EXECUTABLE_TEST): $(OBJECTS_TEST)
@echo 'Building target: $@. First dep: $<'
${CC} -o $(EXECUTABLE_TEST) $(OBJECTS_TEST) $(LDFLAGS) $(DEBUG)
clean:
rm -rf *.o
rm -rf stata_readwrite stata_readwrite_test