-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (37 loc) · 829 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
43
44
PROJ_NAME = azorian
SRC_DIR = src
BUILD_DIR = build
DOCS_DIR = docs
TEST_DIR = tests
INC_DIR = include
LIB_DIR = lib
CC = gcc
REL_CFLAGS = -Wall -Wextra -Wshadow -pedantic -std=c11
DBG_CFLAGS = -Wall -Wextra -Wshadow -pedantic -std=c11 -g3
$(BUILD_DIR)/$(PROJ_NAME).a:
$(CC) -c $(SRC_DIR)/*.c $(REL_CFLAGS)
mv *.o $(BUILD_DIR)
ar -cvq $(BUILD_DIR)/lib$(PROJ_NAME).a $(BUILD_DIR)/*.o
ar -t $(BUILD_DIR)/lib$(PROJ_NAME).a
rm $(BUILD_DIR)/*.o
.PHONY: debug
debug:
$(CC) -c $(SRC_DIR)/*.c $(DBG_CFLAGS)
mv *.o $(BUILD_DIR)
ar -cvq $(BUILD_DIR)/lib$(PROJ_NAME).a $(BUILD_DIR)/*.o
ar -t $(BUILD_DIR)/lib$(PROJ_NAME).a
rm $(BUILD_DIR)/*.o
.PHONY: tests
tests:
cd $(TEST_DIR);\
make all;\
cd ..;
.PHONY: docs
docs:
cd $(SRC_DIR);\
doxygen;\
cd ..;
.PHONY: clean
clean:
rm $(BUILD_DIR)/* -rf
rm $(DOCS_DIR)/* -rf