summaryrefslogtreecommitdiffstats
path: root/lib/javascript/GNUmakefile.in
blob: 4e811999a84bec376144b61542f5e7f62e50023f (plain)
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
# proxy makefile for "autotoolizing" spidermonkey, this is a gross hack as it
# works only with GNU make.
# However only this file (GNUmakefile.in) and .js-distfiles (a list of files to
# include in distribution of lib/javascript) are needed and can be dropped in
# whenever a new version of spidermonkey is put into lib/javascript, with some
# luck it won't break too badly. See distfiles target in this file.

# standard autoconf substitutions
VPATH = @srcdir@
INSTALL = @INSTALL@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
builddir = @builddir@
top_builddir = @top_builddir@

# otherwise linking static libmozjs.a with dynamic libfreej.so won't work
CFLAGS += -fPIC

# the makefile to proxy targets to
js_makefile = $(builddir)/Makefile

# proxy these targets to the real makefile
all export js-config clean libs tools:
	$(MAKE) -f $(js_makefile) $(AM_MAKEFLAGS) $@

# targets required by autotools but which we don't need at all
.PHONY: dvi pdf ps info html installcheck check install uninstall
dvi pdf ps info html installcheck check install uninstall:


# roll our own distdir target :(
# this is the standard autotools target, it uses a file listing all the files
# found in the original distribution of spidermonkey so we copy only those files
# plus our own.
js_distfiles = .js-distfiles
our_distfiles = GNUmakefile.in $(js_distfiles)

distdir:
	test -d "$(distdir)" || exit 0
	test -f "$(srcdir)/$(js_distfiles)" || \
		{ echo "$(srcdir)/$(js_distfiles) missing, run"; \
	    echo "cd lib/javascript && make distfiles"; exit 1; }

  # beware of fragile filenames in $(js_distfiles)
	for f in $(our_distfiles) `cat $(srcdir)/$(js_distfiles)`; do \
		test -e $(distdir)/$$f || \
			$(INSTALL) -D $(srcdir)/$$f $(distdir)/$$f 2>/dev/null; \
	done

# distclean probably can break if spidermonkey generates new files which won't
# be cleaned up by its own distclean afterwards: make distcheck will signal the
# situation and the list of files to be removed below should be updated

# note: errors are not fatal here because javascript is configured only when
# not found on the system and/or --enable-static-mozjs is specified but make
# will always recurse into this directory
distclean:
	-$(MAKE) -f $(js_makefile) $(AM_MAKEFLAGS) distclean
	-rm -f config.status config.log config.cache Makefile
	-rm -f js-config js-config.h mozilla-config.h unallmakefiles
	-rm -rf dist/
	-rm -f config/myconfig.mk config/myrules.mk config/Makefile \
		config/mkdepend/Makefile config/autoconf.mk

# this target is used to build a list of files to copy into $distdir,
# JAVASCRIPT_SRCDIR must point to a js/src directory as found in mozilla
# distribution
distfiles:
	test -e $(JAVASCRIPT_SRCDIR)/jsconfig.mk || \
		{ echo "set JAVASCRIPT_SRCDIR to a directory containing jsconfig.mk"; \
		  exit 1; }
	find $(JAVASCRIPT_SRCDIR) -type f -printf '%P\n' > $(srcdir)/$(js_distfiles)