-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (27 loc) · 923 Bytes
/
Makefile
File metadata and controls
37 lines (27 loc) · 923 Bytes
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
CXX= g++
CXXFLAGS= -g -gdwarf-2 -std=gnu++11 -Wall -Iinclude -fPIC
LDFLAGS= -Llib
AR= ar
ARFLAGS= rcs
LIB_HEADERS= $(wildcard include/sfs/*.h)
LIB_SOURCE= $(wildcard src/library/*.cpp)
LIB_OBJECTS= $(LIB_SOURCE:.cpp=.o)
LIB_STATIC= lib/libsfs.a
SHELL_SOURCE= $(wildcard src/shell/*.cpp)
SHELL_OBJECTS= $(SHELL_SOURCE:.cpp=.o)
SHELL_PROGRAM= bin/sfssh
all: $(LIB_STATIC) $(SHELL_PROGRAM)
%.o: %.cpp $(LIB_HEADERS)
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(LIB_STATIC): $(LIB_OBJECTS) $(LIB_HEADERS)
$(AR) $(ARFLAGS) $@ $(LIB_OBJECTS)
$(SHELL_PROGRAM): $(SHELL_OBJECTS) $(LIB_STATIC)
$(CXX) $(LDFLAGS) -o $@ $(SHELL_OBJECTS) -lsfs
test: $(SHELL_PROGRAM)
@for test_script in tests/test_*.sh; do $${test_script}; done
fs_test: tests/tdd_fs_write.cpp $(LIB_STATIC)
$(CXX) $(CXXFLAGS) $^ -o tests/$@
tests/fs_test
clean:
rm -f $(LIB_OBJECTS) $(LIB_STATIC) $(SHELL_OBJECTS) $(SHELL_PROGRAM)
.PHONY: all clean