-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (23 loc) · 754 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (23 loc) · 754 Bytes
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
include Makefile.config
PREFIX ?= $(prefix)
ATHEME ?= $(source)
ATHEME_CFLAGS = -I$(ATHEME)/include -I$(ATHEME)/libmowgli-2/src/libmowgli -DDATADIR=\"$(PREFIX)/etc\"
SOURCES = $(wildcard *.c)
MODULES = $(patsubst %.c,%.so,$(SOURCES))
default: $(MODULES)
clean:
rm -f $(MODULES)
ifneq ($(WERROR),)
CFLAGS_WERROR = -Werror
endif
%.so: %.c syn.h
gcc -std=c99 -Wall $(CFLAGS_WERROR) -O1 -ggdb3 -fPIC $(ATHEME_CFLAGS) -shared -o$@ $<
.PHONY: install
install: $(MODULES)
install -d $(PREFIX)/modules/syn
for m in $(MODULES); do \
install $${m} $(PREFIX)/modules/syn/$${m}.tmp; \
mv $(PREFIX)/modules/syn/$${m}.tmp $(PREFIX)/modules/syn/$${m} || exit $$?; \
done
install -d $(PREFIX)/help/syn
install -t $(PREFIX)/help/syn help/*