-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (43 loc) · 1.14 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
# gmailc version
VERSION = 0.3
# Customize below to fit your system
# compiler and linker
CC = gcc
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
# includes and libs
INCS = -I/usr/include/libxml2
LIBS = -lcurl -lxml2
# flags
CPPFLAGS = -DVERSION=\"${VERSION}\"
CFLAGS = -std=c11 -pedantic ${INCS} ${CPPFLAGS}
LDFLAGS = ${LIBS}
# enable all warnings
CFLAGS += -Wall -Wextra -Wpedantic \
-Wformat=2 -Wno-unused-parameter -Wshadow \
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition \
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs
# GCC warnings that Clang doesn't provide:
# ifeq ($(CC),gcc)
# CFLAGS += -Wjump-misses-init -Wlogical-op
# endif
# Solaris
# CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
# LDFLAGS = ${LIBS}
all: CFLAGS += -Wjump-misses-init -Wlogical-op
all: CFLAGS += -O2
all: options gmailc
debug: CC = clang
debug: CFLAGS += -g -O0
debug: options gmailc
options:
@echo gmailc build options
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
clean:
@rm gmailc
@rm curl_handler.o
@rm xml_handler.o
gmailc: curl_handler.o xml_handler.o