Subversion Repositories Tewi

Rev

Rev 121 | Rev 129 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 121 Rev 128
Line 1... Line 1...
1
# $Id: Makefile 121 2024-09-21 10:39:17Z nishi $
1
# $Id: Makefile 128 2024-09-23 10:19:19Z nishi $
2
 
2
 
3
PWD = `pwd`
3
PWD = `pwd`
4
PLATFORM = generic
4
PLATFORM = generic
5
PREFIX = /usr/local
5
PREFIX = /usr/local
6
 
6
 
Line 8... Line 8...
8
 
8
 
9
FLAGS = PWD=$(PWD) PLATFORM=$(PLATFORM) PREFIX=$(PREFIX)
9
FLAGS = PWD=$(PWD) PLATFORM=$(PLATFORM) PREFIX=$(PREFIX)
10
 
10
 
11
.PHONY: all format clean ./Server ./Common ./Module ./Manpage get-version
11
.PHONY: all format clean ./Server ./Common ./Module ./Manpage get-version
12
 
12
 
13
all: ./Server ./Module ./Manpage
13
all: ./Server ./Module ./Manpage ./Tool/genconf ./Tool/itworks
14
 
14
 
15
./Server/option: ./Server/option.c
15
./Tool/option: ./Tool/option.c
16
	cc -o $@ ./Server/option.c
16
	cc -o $@ ./Tool/option.c
17
 
17
 
-
 
18
./Tool/genconf: ./Tool/genconf.c
-
 
19
	cc -o $@ ./Tool/genconf.c
-
 
20
 
18
./Server:: ./Common ./Server/option
21
./Server:: ./Common ./Tool/option
19
	$(MAKE) -C $@ $(FLAGS) EXTOBJS="`./Server/option objs ../`" EXTLIBS="`./Server/option libs ../`" EXTCFLAGS="`./Server/option cflags ../`" EXTLDFLAGS="`./Server/option ldflags ../`"
22
	$(MAKE) -C $@ $(FLAGS) EXTOBJS="`./Tool/option objs ../`" EXTLIBS="`./Tool/option libs ../`" EXTCFLAGS="`./Tool/option cflags ../`" EXTLDFLAGS="`./Tool/option ldflags ../`"
20
 
23
 
21
./Module:: ./Common
24
./Module:: ./Common
22
	$(MAKE) -C $@ $(FLAGS)
25
	$(MAKE) -C $@ $(FLAGS)
23
 
26
 
24
./Common::
27
./Common::
25
	$(MAKE) -C $@ $(FLAGS)
28
	$(MAKE) -C $@ $(FLAGS)
26
 
29
 
27
./Manpage::
30
./Manpage::
28
	$(MAKE) -C $@ $(FLAGS)
31
	$(MAKE) -C $@ $(FLAGS)
29
 
32
 
30
install: all
33
install: all ./Tool/genconf ./Tool/itworks
31
	mkdir -p $(PREFIX)/bin $(PREFIX)/lib/tewi $(PREFIX)/share/man/man5 $(PREFIX)/etc
34
	mkdir -p $(PREFIX)/bin $(PREFIX)/lib/tewi $(PREFIX)/share/man/man5 $(PREFIX)/etc $(PREFIX)/www
32
	if [ ! -e $(PREFIX)/etc/tewi.conf ]; then cp example.conf $(PREFIX)/etc/tewi.conf ; fi
35
	if [ ! -e $(PREFIX)/etc/tewi.conf ]; then ( ./Tool/genconf $(PREFIX) > $(PREFIX)/etc/tewi.conf || ( rm $(PREFIX)/etc/tewi.conf ; exit 1 ) ) ; fi
-
 
36
	if [ ! -e $(PREFIX)/www/index.html ]; then ( ./Tool/itworks > $(PREFIX)/www/index.html || ( rm $(PREFIX)/www/index.html ; exit 1 ) ) ; fi
-
 
37
	if [ ! -e $(PREFIX)/www/pbtewi.gif ]; then ( cp Binary/pbtewi.gif $(PREFIX)/www/ || ( rm $(PREFIX)/www/pbtewi.gif ; exit 1 ) ) ; fi
33
	cp ./Server/tewi $(PREFIX)/bin/
38
	cp ./Server/tewi $(PREFIX)/bin/
34
	cp ./Module/*.so $(PREFIX)/lib/tewi/
39
	cp ./Module/*.so $(PREFIX)/lib/tewi/
35
	cp ./Manpage/tewi.conf.5 $(PREFIX)/share/man/man5/
40
	cp ./Manpage/tewi.conf.5 $(PREFIX)/share/man/man5/
36
 
41
 
37
format:
42
format:
Line 43... Line 48...
43
clean:
48
clean:
44
	$(MAKE) -C ./Server $(FLAGS) clean
49
	$(MAKE) -C ./Server $(FLAGS) clean
45
	$(MAKE) -C ./Module $(FLAGS) clean
50
	$(MAKE) -C ./Module $(FLAGS) clean
46
	$(MAKE) -C ./Common $(FLAGS) clean
51
	$(MAKE) -C ./Common $(FLAGS) clean
47
	$(MAKE) -C ./Manpage $(FLAGS) clean
52
	$(MAKE) -C ./Manpage $(FLAGS) clean
48
	rm -f ./Server/option
53
	rm -f ./Tool/option ./Tool/genconf