File: Makefile

package info (click to toggle)
libapache-mod-random 1.4-8.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 96 kB
  • ctags: 59
  • sloc: ansic: 318; sh: 92; makefile: 89
file content (76 lines) | stat: -rw-r--r-- 1,566 bytes parent folder | download | duplicates (3)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
##
##  Makefile -- Build file  for mod_random Apache module
##

#   the used tools
APXS=apxs
APACHECTL=apachectl
VERSION = 1.4
DISTNAME = mod_random
DISTVNAME = $(DISTNAME)-$(VERSION)

SHELL = /bin/sh
PERL = perl
NOOP = $(SHELL) -c true
RM_RF = rm -rf
SUFFIX = .gz
COMPRESS = gzip --best
TAR  = tar
TARFLAGS = cvf
PREOP = @$(NOOP)
POSTOP = @$(NOOP)
TO_UNIX = @$(NOOP)


#   additional defines, includes and libraries
#DEF=-Dmy_define=my_value
#INC=-Imy/include/dir
#LIB=-Lmy/lib/dir -lmylib

#   the default target
all: mod_random.so

#   compile the shared object file
mod_random.so: mod_random.c
	$(APXS) -c $(DEF) $(INC) $(LIB) mod_random.c

#   install the shared object file into Apache 
install: all
	$(APXS) -i -S LIBEXECDIR=$(DESTDIR)/usr/lib/apache/1.3 -n 'random' mod_random.so

#   cleanup
clean:
	-rm -f mod_random.o mod_random.so

#   install and activate shared object by reloading Apache to
#   force a reload of the shared object file
reload: install stop start

#   the general Apache start/restart/stop
#   procedures
start:
	$(APACHECTL) start
restart:
	$(APACHECTL) restart
stop:
	$(APACHECTL) stop

dist: version $(DISTVNAME).tar$(SUFFIX)

version:
	echo $(VERSION) > VERSION
#	echo "#define VERSION \"$(VERSION)\"" > version.h

$(DISTVNAME).tar$(SUFFIX) : distdir
	$(PREOP)
	$(TO_UNIX)
	$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
	$(RM_RF) $(DISTVNAME)
	$(COMPRESS) $(DISTVNAME).tar
		$(POSTOP)

distdir :
	$(RM_RF) $(DISTVNAME)
	$(PERL) -MExtUtils::Manifest=manicopy,maniread \
		-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"