1 include Makefile.config
5 .PHONY
: all byte opt doc
19 ### Testing and debugging : local execution and toplevel ###
21 .PHONY
: run.local run.opt.local top
24 CAML_LD_LIBRARY_PATH
=src
/server src
/server
/${PROJECTNAME} -c local
/etc
/${PROJECTNAME}.conf
27 CAML_LD_LIBRARY_PATH
=src
/server src
/server
/${PROJECTNAME}.opt
-c local
/etc
/${PROJECTNAME}.conf
30 cd src
/server
&& ${MAKE} top
38 -rm -f
$(PROJECTNAME
)-*.
tar.gz
40 distclean: clean.local
41 ${MAKE} -C src
distclean
48 .PHONY
: install partialinstall reinstall
uninstall
51 $(MAKE
) -C src
install
53 $(MAKE
) -C src
install.byte
55 $(MAKE
) -C src
install.opt
57 reinstall
: uninstall install
58 reinstall.byte
: uninstall install.byte
59 reinstall.opt
: uninstall install.opt
61 install: install.META
install.files
63 @echo
"## Run \"make doc\" and \"make install.doc\" to build and install the ocamldoc."
65 install.byte
: install.META.byte
install.files
66 install.opt
: install.META.opt
install.files
70 $(INSTALL
) -m
755 -d
$(dir $(TEMPROOT
)$(COMMANDPIPE
))
71 [ -p
$(TEMPROOT
)$(COMMANDPIPE
) ] || \
72 { mkfifo
$(TEMPROOT
)$(COMMANDPIPE
); \
73 $(CHMOD
) 660 $(TEMPROOT
)$(COMMANDPIPE
); \
74 $(CHOWN
) -R
$(OCSIGENUSER
):$(OCSIGENGROUP
) $(TEMPROOT
)$(COMMANDPIPE
); }
75 ## Configuration files
76 $(INSTALL
) -m
755 -d
$(TEMPROOT
)$(CONFIGDIR
)/conf.d
77 ${INSTALL} -m
644 ${PROJECTNAME}.conf.sample
$(TEMPROOT
)$(CONFIGDIR
)/
78 [ -f
$(TEMPROOT
)$(CONFIGDIR
)/$(PROJECTNAME
).conf
] || \
79 { $(INSTALL
) -m
644 $(PROJECTNAME
).conf.sample \
80 $(TEMPROOT
)$(CONFIGDIR
)/$(PROJECTNAME
).conf
; }
81 -mv
$(TEMPROOT
)$(CONFIGDIR
)/mime.types
$(TEMPROOT
)$(CONFIGDIR
)/mime.types.old
83 $(INSTALL
) -m
644 src
/files
/mime.types
$(TEMPROOT
)$(CONFIGDIR
)
84 $(INSTALL
) -d
-m
755 -o
${OCSIGENUSER} -g
${OCSIGENGROUP} \
87 $(INSTALL
) -d
-m
755 -o
${OCSIGENUSER} -g
${OCSIGENGROUP} \
88 $(TEMPROOT
)$(STATICPAGESDIR
)
89 $(INSTALL
) -d
-m
750 -o
${OCSIGENUSER} -g
${OCSIGENGROUP} \
91 $(INSTALL
) -m
644 -o
${OCSIGENUSER} -g
${OCSIGENGROUP} \
92 local
/var
/www
/*.html
$(TEMPROOT
)$(STATICPAGESDIR
)
93 $(INSTALL
) -d
-m
755 -o
${OCSIGENUSER} -g
${OCSIGENGROUP} \
94 $(TEMPROOT
)$(STATICPAGESDIR
)/ocsigenstuff
95 $(INSTALL
) -m
644 -o
${OCSIGENUSER} -g
${OCSIGENGROUP} \
96 local
/var
/www
/ocsigenstuff
/* $(TEMPROOT
)$(STATICPAGESDIR
)/ocsigenstuff
97 $(INSTALL
) -d
-m
755 $(TEMPROOT
)$(MANDIR
)
98 $(INSTALL
) -m
644 src
/files
/${PROJECTNAME}.1 $(TEMPROOT
)$(MANDIR
)
101 -make
-C doc
uninstall
102 -rm -f
$(TEMPROOT
)$(CONFIGDIR
)/$(PROJECTNAME
).conf.sample
103 -rm -f
$(TEMPROOT
)$(MANDIR
)/${PROJECTNAME}.1
104 -rm -f
$(TEMPROOT
)$(COMMANDPIPE
)
105 -rmdir
--ignore-fail-on-non-empty
$(TEMPROOT
)$(CONFIGDIR
)/conf.d
106 -rmdir
--ignore-fail-on-non-empty
$(TEMPROOT
)$(CONFIGDIR
)
107 -rmdir
--ignore-fail-on-non-empty
$(TEMPROOT
)$(LOGDIR
)
108 -rmdir
--ignore-fail-on-non-empty
$(TEMPROOT
)$(DATADIR
)
109 -rmdir
--ignore-fail-on-non-empty
$(TEMPROOT
)$(MANDIR
)
110 -$(MAKE
) -C src
uninstall
113 ${MAKE} -C doc
install
115 ### Install logrotate configuration files ###
120 $(INSTALL
) -m
755 -d
$(TEMPROOT
)/etc
/logrotate.d
121 cat src
/files
/logrotate.in \
122 | sed s
%LOGDIR
%$(LOGDIR
)%g \
123 | sed s
%USER
%$(OCSIGENUSER
)%g \
124 | sed s
%GROUP
%$(OCSIGENGROUP
)%g \
125 | sed s
%_COMMANDPIPE_
%$(COMMANDPIPE
)%g \
126 > $(TEMPROOT
)/etc
/logrotate.d
/$(PROJECTNAME
); }
132 VERSION
:= $(shell head
-n
1 VERSION
)
134 DARCS_REPO
=$(PWD
) darcs
dist -d
$(PROJECTNAME
)-$(VERSION
)
140 ${MAKE} -C src depend