Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove config files generation from Makefiles #234

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ default all: build

.PHONY: build
build:
${MAKE} -C src
dune build
${MAKE} -C src/server build
doc:
$(MAKE) -C doc

Expand All @@ -28,13 +29,14 @@ top:
### Cleaning ###

clean: clean.local
${MAKE} -C src clean
${MAKE} -C src/server clean

clean.local:
dune clean
-rm -f ocsigenserver-*.tar.gz

distclean: clean.local
${MAKE} -C src distclean
${MAKE} -C src/server distclean
-make -C doc clean
-rm Makefile.config
-rm -f *~ \#* .\#*
Expand Down
9 changes: 0 additions & 9 deletions Makefile.options
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,3 @@ INCS= -I ${BLD}/server/.ocsigenserver.objs/byte \
SERVER_PACKAGE := lwt_ssl,bytes,lwt.unix,lwt_log,ipaddr,findlib,cryptokit,re,str,xml-light,dynlink,cohttp-lwt-unix,hmap

LIBS := -package ${SERVER_PACKAGE} ${INCS}

INITPACKAGE := \"$(shell ${OCAMLFIND} query -p-format -recursive \
-separator '\";\"' ${SERVER_PACKAGE})\"; \
\"ocsigenserver.polytables\"; \
\"ocsigenserver.cookies\"; \
\"ocsigenserver.baselib.base\"; \
\"ocsigenserver.baselib\"; \
\"ocsigenserver.http\"; \
\"ocsigenserver\"; \
39 changes: 21 additions & 18 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ set_defaults () {
bindir=""
logdir=""
libdir=""
libdir_set=0
mandir=""
docdir=""
sysconfdir="/etc/ocsigenserver"
Expand Down Expand Up @@ -282,6 +283,7 @@ while [ "$#" -gt 0 ]; do
;;
--libdir)
libdir="$2"
libdir_set=1
shift
shift
;;
Expand Down Expand Up @@ -485,32 +487,14 @@ CC := gcc
# optional
RLWRAP := $rlwrap


### Options ###

# User who will run Ocsigen server (not root) (eg, for debian, www-data)
# (This user must exist on your system)
OCSIGENUSER := $ocsigen_user

# group who will run Ocsigen server (not root) (eg, for debian, www-data)
# (This group must exist)
OCSIGENGROUP := $ocsigen_group


### Paths ###

# Temporary root directory to install the package (usually always "" but for package makers)
TEMPROOT := $temproot

# The directory for ocsigen server (binary):
BINDIR := $root$bindir

# The directory for ocsigen manpage:
MANDIR := $root$mandir

# Where to install the libraries
LIBDIR := $libdir

# ocsigen's logs:
LOGDIR := $root$logdir

Expand Down Expand Up @@ -538,6 +522,25 @@ SRC := $full_pwd
include \$(SRC)/Makefile.options
_EOF_

echo "Writing config options"
cat <<_EOF_ > $my_pwd/src/files/ocsigenserver.conf/options.ml
let version = "$version"
let src = "$full_pwd"
let port = 80
let ocsigenuser = "$ocsigen_user"
let ocsigengroup = "$ocsigen_group"
let bindir = "$root$bindir"
let libdir = "$libdir"
let libdir_set = $libdir_set
let logdir = "$root$logdir"
let configdir = "$root$sysconfdir"
let staticpagesdir = "$root$staticpagesdir"
let datadir = "$root$datadir"
let uploaddir = "$root$uploaddir"
let commandpipe = "$root$commandpipe"
let mimefile = "$root$sysconfdir/mime.types"
_EOF_

######################################################################
# Finish

Expand Down
19 changes: 19 additions & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(rule
(mode
(promote (until-clean)))
(target ocsigenserver.conf.sample)
(action
(with-stdout-to
%{target}
(run src/files/ocsigenserver.conf/gen.exe sample))))

(subdir
local/etc
(rule
(mode
(promote (until-clean)))
(target ocsigenserver.conf)
(action
(with-stdout-to
%{target}
(run ../../src/files/ocsigenserver.conf/gen.exe local)))))
69 changes: 0 additions & 69 deletions src/Makefile

This file was deleted.

41 changes: 0 additions & 41 deletions src/baselib/Makefile

This file was deleted.

5 changes: 5 additions & 0 deletions src/baselib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@
(select dynlink_wrapper.ml from
(dynlink -> dynlink_wrapper.natdynlink.ml)
(_ -> dynlink_wrapper.nonatdynlink.ml))))

(rule
(with-stdout-to
ocsigen_config_static.ml
(run ../files/ocsigenserver.conf/gen.exe static.ml)))
14 changes: 0 additions & 14 deletions src/extensions/Makefile

This file was deleted.

42 changes: 0 additions & 42 deletions src/files/ocsigenserver.conf.in

This file was deleted.

3 changes: 3 additions & 0 deletions src/files/ocsigenserver.conf/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(executable
(name gen)
(libraries str unix))
Loading