Line | |
---|
1 | # $Id: Makefile 121 2024-09-21 10:39:17Z nishi $
|
---|
2 |
|
---|
3 | PWD = `pwd`
|
---|
4 | PLATFORM = generic
|
---|
5 | PREFIX = /usr/local
|
---|
6 |
|
---|
7 | include Platform/$(PLATFORM).mk
|
---|
8 |
|
---|
9 | FLAGS = PWD=$(PWD) PLATFORM=$(PLATFORM) PREFIX=$(PREFIX)
|
---|
10 |
|
---|
11 | .PHONY: all format clean ./Server ./Common ./Module ./Manpage get-version
|
---|
12 |
|
---|
13 | all: ./Server ./Module ./Manpage
|
---|
14 |
|
---|
15 | ./Server/option: ./Server/option.c
|
---|
16 | cc -o $@ ./Server/option.c
|
---|
17 |
|
---|
18 | ./Server:: ./Common ./Server/option
|
---|
19 | $(MAKE) -C $@ $(FLAGS) EXTOBJS="`./Server/option objs ../`" EXTLIBS="`./Server/option libs ../`" EXTCFLAGS="`./Server/option cflags ../`" EXTLDFLAGS="`./Server/option ldflags ../`"
|
---|
20 |
|
---|
21 | ./Module:: ./Common
|
---|
22 | $(MAKE) -C $@ $(FLAGS)
|
---|
23 |
|
---|
24 | ./Common::
|
---|
25 | $(MAKE) -C $@ $(FLAGS)
|
---|
26 |
|
---|
27 | ./Manpage::
|
---|
28 | $(MAKE) -C $@ $(FLAGS)
|
---|
29 |
|
---|
30 | install: all
|
---|
31 | mkdir -p $(PREFIX)/bin $(PREFIX)/lib/tewi $(PREFIX)/share/man/man5 $(PREFIX)/etc
|
---|
32 | if [ ! -e $(PREFIX)/etc/tewi.conf ]; then cp example.conf $(PREFIX)/etc/tewi.conf ; fi
|
---|
33 | cp ./Server/tewi $(PREFIX)/bin/
|
---|
34 | cp ./Module/*.so $(PREFIX)/lib/tewi/
|
---|
35 | cp ./Manpage/tewi.conf.5 $(PREFIX)/share/man/man5/
|
---|
36 |
|
---|
37 | format:
|
---|
38 | clang-format --verbose -i `find ./Server ./Common ./Module "(" -name "*.c" -or -name "*.h" ")" -and -not -name "strptime.*"` config.h
|
---|
39 |
|
---|
40 | get-version:
|
---|
41 | @grep "define TW_VERSION" Server/tw_version.h | grep -Eo '"[^\]+' | sed -E 's/^"//g'
|
---|
42 |
|
---|
43 | clean:
|
---|
44 | $(MAKE) -C ./Server $(FLAGS) clean
|
---|
45 | $(MAKE) -C ./Module $(FLAGS) clean
|
---|
46 | $(MAKE) -C ./Common $(FLAGS) clean
|
---|
47 | $(MAKE) -C ./Manpage $(FLAGS) clean
|
---|
48 | rm -f ./Server/option
|
---|
Note:
See
TracBrowser
for help on using the repository browser.