-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (35 loc) · 1.07 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
PROGNM = hgweb
CC ?= gcc
CFLAGS ?= -O2 -fPIE -flto -fstack-protector-strong --param=ssp-buffer-size=1 -Wno-reserved-id-macro -Wall -Wextra -Wpedantic -Werror -std=gnu18 -fsanitize=undefined -march=native
LDFLAGS += `pkg-config --libs lwan`
VER = `git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'`
FMFLAGS = -wp -then -wp -wp-rte
SOURCES ?= $(wildcard src/*.c)
PACKAGES ?= lwan-git hitch uacme
TARGET ?= oceanus.halosgho.st
PORT ?= 2222
WATCHDIRS ?= src pages assets media
ifneq ($(CC), tcc)
CFLAGS += -pie -D_FORTIFY_SOURCE=2
LDFLAGS += -Wl,-z,relro,-z,now
endif
ifeq ($(CC), clang)
CFLAGS += -Weverything -fsanitize-trap=undefined
endif
CFLAGS += -Wno-disabled-macro-expansion
BLDRT ?= dist
CONFIGURATION ?= debug
ifneq ($(CONFIGURATION), release)
BLDDIR ?= $(BLDRT)/debug
CFLAGS += -g -ggdb -O0 -U_FORTIFY_SOURCE
else
BLDDIR ?= $(BLDRT)/release
CFLAGS += -DNDEBUG -O3
endif
include mke/rules
ifneq ($(wildcard ./overrides.mk),)
include ./overrides.mk
endif
WEBDIR := /srv/http
MAINDIR := $(DESTDIR)$(WEBDIR)
SVCDIR := $(DESTDIR)$(PREFIX)/lib/systemd/system/