-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.analyzer
34 lines (23 loc) · 1.29 KB
/
Makefile.analyzer
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
SALDL_VERSION = `git describe --tags --long --dirty`
BLD_DIR = build_analyzer
DEFINES = -D_GNU_SOURCE -DHAVE_FILENO -DHAVE_ISATTY -DHAVE_STRSIGNAL -DHAVE_STRCASESTR -DHAVE_MKDIR -DHAVE_CLOCK_MONOTONIC_RAW -DHAVE_STRFTIME -DHAVE_SIGACTION -DHAVE_SIGADDSET -DHAVE_IOCTL -D_FILE_OFFSET_BITS=64 -DSALDL_VERSION=\"$(SALDL_VERSION)\"
COMMON_CFLAGS = -pipe -std=c99 -pedantic -Wall -Wextra -Werror -Wmissing-format-attribute
COMMON_LIBS = -levent_pthreads -levent -lcurl -pthread
CRCS = common.c log.c utime.c exit.c events.c progress.c write_modes.c resume.c status.c ctrl.c merge.c queue.c transfer.c saldl.c main.c
OBJS = $(patsubst %.c,${BLD_DIR}/%.o,${CRCS})
HEADER_NAMES = common.h log.h utime.h exit.h events.h progress.h write_modes.h resume.h status.h ctrl.h merge.h queue.h saldl.h saldl_params.h structs.h transfer.h vt100.h defaults.h
HEADERS = $(patsubst %,src/%,${HEADER_NAMES})
all: prep-internal saldl
prep:
$(eval CFLAGS = ${COMMON_CFLAGS} ${CFLAGS})
$(eval LDFLAGS = ${COMMON_LDFLAGS} ${LDFLAGS})
$(eval LIBS = ${COMMON_LIBS} ${LIBS})
prep-internal: prep
rm -rf ${BLD_DIR}
mkdir -p ${BLD_DIR}
${OBJS}: ${SRCS} $(HEADERS)
${CC} -c src/$(notdir ${@:.o=.c}) -o ${@} ${CFLAGS} ${DEFINES}
saldl: $(OBJS)
${CC} -o ${BLD_DIR}/saldl ${OBJS} ${CFLAGS} ${LDFLAGS} ${LIBS}
clean:
-rm -rf ${BLD_DIR}/