-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
56 lines (42 loc) · 1.05 KB
/
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
#
# Makefile
# By Benjamin Kittridge. Copyright (C) 2011, All rights reserved.
#
#
###################################################
# Options
NAME = ubridge
VERSION = 1.0
BIN_PATH = bin
BIN = ubridge
SRC_PATH = src
SRC = $(patsubst %.c,%.o,$(wildcard ${SRC_PATH}/*.c)) \
$(patsubst %.c,%.o,$(wildcard ${SRC_PATH}/*/*.c)) \
$(patsubst %.c,%.o,$(wildcard ${SRC_PATH}/*/*/*.c))
LINK_ARG = -pthread
COMPILE_ARG = -g -iquote ${SRC_PATH} -Wimplicit -Wall -Wextra -Werror \
--std=gnu99 -DVERSION=\"${VERSION}\"
###################################################
# Programs
ECHO = echo
GCC = gcc
RM = rm
MKDIR = mkdir
###################################################
# Build
all: info build
info:
@${ECHO} "BUILDING: ${NAME}"
-include $(SRC:.o=.d)
.SUFFIXES:
.SUFFIXES: .c .so .o
.c.o:
@${ECHO} "COMPILE: $<"
@${GCC} -MD -c $< -o $@ ${COMPILE_ARG}
build: ${SRC}
@${MKDIR} -p ${BIN_PATH}
@${ECHO} "LINK: ${BIN_PATH}/${BIN}"
@${GCC} -o ${BIN_PATH}/${BIN} ${SRC} ${LINK_ARG}
@${ECHO}
clean:
@${RM} -f ${BIN_PATH}/${BIN} ${SRC} $(SRC:.o=.d)