File: Makefile

package info (click to toggle)
liquidsoap 2.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,924 kB
  • sloc: ml: 73,577; javascript: 24,836; sh: 3,440; makefile: 764; xml: 114; ansic: 96; lisp: 62; python: 35; perl: 8; ruby: 8
file content (117 lines) | stat: -rw-r--r-- 4,305 bytes parent folder | download
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
-include Makefile.defs

DISTFILES = \
	CHANGES CHANGES.md COPYING README README.md \
	bootstrap configure.ac configure config.sub config.guess m4 \
	Makefile Makefile.defs.in install-sh \
	liquidsoap.opam $(wildcard libs/*liq) scripts

all:
	$(MAKE) -C src $@

clean:
	$(MAKE) -C src $@
	$(MAKE) -C doc $@
	$(MAKE) -C tests $@

doc:
	if [ "$(OS_TYPE)" = "Win32" ]; then \
	  echo "Building documentation is currently not working on windows, skipping..."; \
        else \
	  $(MAKE) -C src $@; \
	  $(MAKE) -C doc $@; \
	fi

configure: configure.ac install-sh
	./bootstrap
	./configure-with-options || ./configure

distclean:
	rm -f Makefile.defs
	rm -rf config.log config.status autom4te.cache src/configure.ml scripts/liquidsoap.logrotate liquidsoap.config $(DISTDIR) $(DISTDIR).tar.bz2

test:
	@$(MAKE) -C src/test $@
	@$(MAKE) -C tests $@

.PHONY: clean test distclean doc finish-configure

finish-configure:
ifneq ($(CUSTOM_PATH),yes)
	@echo let rundir = \"$(localstatedir)/run/liquidsoap\" >> src/configure.ml
	@echo let logdir = \"$(localstatedir)/log/liquidsoap\" >> src/configure.ml
	@echo let liq_libs_dir = \"$(liq_libs_dir)/libs\" >> src/configure.ml
	@echo let bin_dir = \"$(liq_libs_dir)/bin\" >> src/configure.ml
	@echo let \(\) = add_subst \"\<sysrundir\>\" \"$(localstatedir)/run/liquidsoap\" >> src/configure.ml
	@echo let \(\) = add_subst \"\<syslogdir\>\" \"$(localstatedir)/log/liquidsoap\" >> src/configure.ml
else
	@echo let rundir = get_dir \"run\" >> src/configure.ml
	@echo let logdir = get_dir \"logs\" >> src/configure.ml
	@echo let liq_libs_dir = get_dir \"libs\" >> src/configure.ml
	@echo let bin_dir = get_dir \".\" >> src/configure.ml
	@echo let \(\) = add_subst \"\<sysrundir\>\" \".\" >> src/configure.ml
	@echo let \(\) = add_subst \"\<syslogdir\>\" \".\" >> src/configure.ml
endif
	@echo let restart = ref false >> src/configure.ml
	@echo let display_types = ref false >> src/configure.ml
	@echo let exe_ext = \"$(EXEEXT)\" >> src/configure.ml
	@echo "let vendor = \
                  Printf.sprintf \"Liquidsoap/%s (%s; OCaml %s)\" \
                     version Sys.os_type Sys.ocaml_version" >> src/configure.ml
	@echo "let () = Printexc.record_backtrace true" >> src/configure.ml
	@echo "let path = \
          let s = try Sys.getenv \"PATH\" with Not_found -> \"\" in \
          bin_dir :: (Str.split (Str.regexp_string \":\") s)" >> src/configure.ml
	@echo Creating scripts/liquidsoap.logrotate
	@cat scripts/liquidsoap.logrotate.in | \
	  sed -e s:@localstatedir@:$(localstatedir): > scripts/liquidsoap.logrotate

.PHONY: doc-install api-doc-install
doc-install: doc
	if [ "$(OS_TYPE)" != "Win32" ]; then \
	  $(MAKE) -C doc $@; \
	fi
api-doc-install:
	$(V)echo "Installing developer documentation..."
	$(V)$(INSTALL) -d $(datadir)/doc/$(DISTDIR)/api
	$(V)for doc in $(wildcard autodoc/liquidsoap/*.html autodoc/liquidsoap/*.css) ;\
	do $(INSTALL_DATA) $$doc $(datadir)/doc/$(DISTDIR)/api ; \
	done

# user and group are defined in Makefile.defs, written by configure.
.PHONY: install dist print-tarball-filename tarball
install: doc-install
	$(MAKE) -C src $@
ifeq ($(INSTALL_DAEMON),yes)
	$(INSTALL_DIRECTORY) -o ${user} -g ${group} -m 2775 ${localstatedir}/log/liquidsoap
	$(INSTALL_DIRECTORY) -o ${user} -g ${group} -m 2775 ${localstatedir}/run/liquidsoap
endif
	$(INSTALL_DIRECTORY) $(bindir)
	$(INSTALL_DIRECTORY) $(liq_libs_dir)/bin
	$(INSTALL_DIRECTORY) $(liq_libs_dir)/libs
	$(INSTALL_PROGRAM) scripts/extract-replaygain $(liq_libs_dir)/bin
	find libs | grep '\.liq$$' | while read l; do \
	  $(INSTALL_DATA) $$l $(liq_libs_dir)/libs ; \
	done
	$(INSTALL_DIRECTORY) ${sysconfdir}/liquidsoap
	$(INSTALL_DIRECTORY) ${sysconfdir}/logrotate.d
	$(INSTALL_DATA) scripts/liquidsoap.logrotate ${sysconfdir}/logrotate.d/liquidsoap
	-$(INSTALL_DIRECTORY) ${bashcompdir}
	-$(INSTALL_DATA) scripts/bash-completion ${bashcompdir}/liquidsoap
	$(INSTALL_DIRECTORY) ${emacsdir}
	$(INSTALL_DATA) scripts/liquidsoap-mode.el ${emacsdir}/

dist:
	rm -rf $(DISTDIR)
	mkdir $(DISTDIR)
	rsync -amRr $(DISTFILES) $(DISTDIR)
	$(MAKE) -C src DISTDIR=../$(DISTDIR) $@
	$(MAKE) -C doc DISTDIR=../$(DISTDIR) $@
	$(MAKE) -C tests DISTDIR=../$(DISTDIR) $@

print-tarball-filename:
	@printf $(DISTDIR).tar.bz2

tarball: dist
	tar cjf $(DISTDIR).tar.bz2 $(DISTDIR)
	rm -rf $(DISTDIR)