-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (40 loc) · 1017 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
##
## Made by Emmanuel Chambon
## chambo_e <[email protected]>
##
## Started on Wed Apr 8 22:49:16 2015 Emmanuel Chambon
## Last update Sun Jul 12 21:53:16 2015 Emmanuel Chambon
##
DEBUG = yes
CC = gcc
RM = rm -fr
BIN = libspec.so
SRC = timespec_extended.c \
timespec_add.c \
timespec_sub.c \
timespec_cmp.c \
timespec_lib.c
OBJ_DIR = obj/
SRC_DIR = src/
INC_DIR = include/
CFLAGS = -std=c11 -W -Wall -Wextra -I$(INC_DIR) -fPIC
ifeq ($(DEBUG),yes)
CFLAGS += -g3
else
CFLAGS += -O3
endif
BUILD_PRINT = \e[1;34mBuilding\e[0m \e[1;33m$<\e[0m
OBJS = $(patsubst %.c,${OBJ_DIR}%.o, $(SRC))
FIRST := $(shell test -d $(OBJ_DIR) || mkdir $(OBJ_DIR))
$(OBJ_DIR)%.o : $(patsubst %.c, ${SRC_DIR}%.c, %.c)
@echo -e "$(BUILD_PRINT)" && $(CC) $(CFLAGS) -c $< -o $@
$(BIN) : $(OBJS)
$(CC) $(OBJS) -shared -o $(BIN)
all :
@$(MAKE) --no-print-directory $(BIN)
$(clean)
clean :
$(RM) $(OBJS) $(OBJ_DIR)
fclean : clean
$(RM) $(BIN)
re : fclean all