-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (44 loc) · 1.13 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
MAKEFLAGS += --warn-undefined-variables
SHELL := /bin/bash -euo pipefail
CC ?= gcc
CFLAGS += -std=c11
CFLAGS += -D_POSIX_C_SOURCE=200809
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Wpedantic
CFLAGS += -Wundef
CPPFLAGS ?=
TARGET_ARCH ?=
LOADLIBES ?=
LDFLAGS ?=
LDLIBS ?=
SRCS += block
SRCS += block_ext
SRCS += block_ext_app
SRCS += block_ext_comment
SRCS += block_ext_gp_ctrl
SRCS += block_ext_plain_text
SRCS += block_frame
SRCS += block_image
SRCS += header
SRCS += lgtm
SRCS += tool
OBJS := $(addsuffix .o,$(SRCS))
define link
$(strip $(LINK.o)) $^ $(LOADLIBES) $(LDLIBS) -o $@
endef
build: lgtm-gif-animation
lgtm-gif-animation: CFLAGS += -O2
lgtm-gif-animation: main.o $(OBJS)
$(call link)
debug: lgtm-gif-animation-debug
lgtm-gif-animation-debug: CFLAGS += -g
lgtm-gif-animation-debug: CPPFLAGS += -DDEBUG
lgtm-gif-animation-debug: main.o $(OBJS)
$(call link)
lint:
@type cpplint
@cpplint *.h *.c
clean:
@rm -f lgtm-gif-animation lgtm-gif-animation-debug *.o
.PHONY: build debug lint clean