-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 1.1 KB
/
Makefile
File metadata and controls
51 lines (40 loc) · 1.1 KB
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
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: (c) Copyright 2024 Andrew Bower <andrew@bower.uk>
VERSION ?= 3.0.0
prefix ?= /usr/local
CFLAGS ?= -g -O2
CFLAGS += -MMD -MP \
-Wall -Wimplicit-fallthrough -Werror \
-std=c23 \
-D_GNU_SOURCE \
-DUNHTML_VERSION=$(VERSION) -DINST_PREFIX=$(prefix)\
-I/usr/include/libxml2
LDLIBS = -lgumbo -lxml2
LOOSE_DIFF = diff -u --ignore-space-change --ignore-blank-lines
INSTALL = install
DEP = $(wildcard *.d)
prefix ?= /usr
name := unhtml
testfiles := testfiles/
OBJS = unhtml.o load.o config.o render.o
ifndef NO_GUMBO
CFLAGS += -DWITH_GUMBO
LDLIBS += -lgumbo
OBJS += parse-gumbo.o
endif
ifndef NO_LIBXML2
CFLAGS += -DWITH_LIBXML2 -I/usr/include/libxml2
LDLIBS += -lxml2
OBJS += parse-libxml2.o
endif
.PHONY: all clean install
all: $(name)
-include $(DEP)
$(name): $(OBJS)
clean:
$(RM) $(name) $(OBJS) $(DEP)
install:
$(INSTALL) -m 755 -D -t $(DESTDIR)$(prefix)/bin $(name)
$(INSTALL) -m 644 -D -t $(DESTDIR)$(prefix)/share/man/man1 $(name).1
$(INSTALL) -m 644 -D -t $(DESTDIR)$(prefix)/share/$(name) $(wildcard default/*.xml)
include test.mk