summaryrefslogtreecommitdiff
path: root/lib/javascript/GNUmakefile.in blob: 4e811999a84bec376144b61542f5e7f62e50023f
1# proxy makefile for "autotoolizing" spidermonkey, this is a gross hack as it
2# works only with GNU make.
3# However only this file (GNUmakefile.in) and .js-distfiles (a list of files to
4# include in distribution of lib/javascript) are needed and can be dropped in
5# whenever a new version of spidermonkey is put into lib/javascript, with some
6# luck it won't break too badly. See distfiles target in this file.
7
8# standard autoconf substitutions
9VPATH = @srcdir@
10INSTALL = @INSTALL@
11abs_builddir = @abs_builddir@
12abs_srcdir = @abs_srcdir@
13abs_top_builddir = @abs_top_builddir@
14abs_top_srcdir = @abs_top_srcdir@
15srcdir = @srcdir@
16top_srcdir = @top_srcdir@
17builddir = @builddir@
18top_builddir = @top_builddir@
19
20# otherwise linking static libmozjs.a with dynamic libfreej.so won't work
21CFLAGS += -fPIC
22
23# the makefile to proxy targets to
24js_makefile = $(builddir)/Makefile
25
26# proxy these targets to the real makefile
27all export js-config clean libs tools:
28 $(MAKE) -f $(js_makefile) $(AM_MAKEFLAGS) $@
29
30# targets required by autotools but which we don't need at all
31.PHONY: dvi pdf ps info html installcheck check install uninstall
32dvi pdf ps info html installcheck check install uninstall:
33
34
35# roll our own distdir target :(
36# this is the standard autotools target, it uses a file listing all the files
37# found in the original distribution of spidermonkey so we copy only those files
38# plus our own.
39js_distfiles = .js-distfiles
40our_distfiles = GNUmakefile.in $(js_distfiles)
41
42distdir:
43 test -d "$(distdir)" || exit 0
44 test -f "$(srcdir)/$(js_distfiles)" || \
45 { echo "$(srcdir)/$(js_distfiles) missing, run"; \
46 echo "cd lib/javascript && make distfiles"; exit 1; }
47
48 # beware of fragile filenames in $(js_distfiles)
49 for f in $(our_distfiles) `cat $(srcdir)/$(js_distfiles)`; do \
50 test -e $(distdir)/$$f || \
51 $(INSTALL) -D $(srcdir)/$$f $(distdir)/$$f 2>/dev/null; \
52 done
53
54# distclean probably can break if spidermonkey generates new files which won't
55# be cleaned up by its own distclean afterwards: make distcheck will signal the
56# situation and the list of files to be removed below should be updated
57
58# note: errors are not fatal here because javascript is configured only when
59# not found on the system and/or --enable-static-mozjs is specified but make
60# will always recurse into this directory
61distclean:
62 -$(MAKE) -f $(js_makefile) $(AM_MAKEFLAGS) distclean
63 -rm -f config.status config.log config.cache Makefile
64 -rm -f js-config js-config.h mozilla-config.h unallmakefiles
65 -rm -rf dist/
66 -rm -f config/myconfig.mk config/myrules.mk config/Makefile \
67 config/mkdepend/Makefile config/autoconf.mk
68
69# this target is used to build a list of files to copy into $distdir,
70# JAVASCRIPT_SRCDIR must point to a js/src directory as found in mozilla
71# distribution
72distfiles:
73 test -e $(JAVASCRIPT_SRCDIR)/jsconfig.mk || \
74 { echo "set JAVASCRIPT_SRCDIR to a directory containing jsconfig.mk"; \
75 exit 1; }
76 find $(JAVASCRIPT_SRCDIR) -type f -printf '%P\n' > $(srcdir)/$(js_distfiles)
77