-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (30 loc) · 876 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
# SPDX-License-Identifier: GPL-2.0-or-later */
#
# Copyright(c) 2024 John Sanpe <[email protected]>
#
SDBD_C_FLAGS = -Wall -Wextra -Wno-unused-parameter \
-Wl,--gc-sections -ffunction-sections -fdata-sections \
-lbfenv -lbfdev -lpthread -lutil
SDBD_C_DEBUG_FLAGS = $(SDBD_C_FLAGS) -g -DDEBUG \
-fsanitize=address -fsanitize=undefined \
-fsanitize-recover=all -fno-omit-frame-pointer \
-fno-stack-protector
all: sdbd
debug: sdbd-debug
PHONY += all debug
clean:
rm -rf sdbd sdbd-debug
PHONY += all
install: sdbd
install -Dm755 sdbd /usr/local/bin/sdbd
PHONY += install
uninstall:
rm -f /usr/local/bin/sdbd
PHONY += uninstall
sdbd: sdbd.c
$(CROSS_COMPILE)gcc -o $@ $^ -O2 $(SDBD_C_FLAGS)
$(CROSS_COMPILE)strip $@
sdbd-debug: sdbd.c
$(CROSS_COMPILE)gcc -o $@ $^ -O0 $(SDBD_C_DEBUG_FLAGS)
# Declare the contents of the PHONY variable as phony.
.PHONY: $(PHONY)