forked from TritonDataCenter/javascriptlint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (47 loc) · 1.46 KB
/
Makefile
File metadata and controls
62 lines (47 loc) · 1.46 KB
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
BUILDOS=$(shell uname -s)
BUILDDIR = build
INSTALLDIRS = \
$(BUILDDIR)/install \
$(BUILDDIR)/install/javascriptlint \
CSRCS = \
nodepos.c \
pyspidermonkey.c
OBJECTS = $(CSRCS:%.c=$(BUILDDIR)/%.o)
CFLAGS += -fno-strict-aliasing -O -fPIC
CPPFLAGS += -DNDEBUG -D_REENTRANT \
-Ispidermonkey/src \
-Ispidermonkey/src/build \
-I/usr/include
SOLDFLAGS += -shared
ifeq ($(BUILDOS),Darwin)
# Assumes you've done `brew install python` (2.7)
CC=gcc
LD=gcc
CPPFLAGS += -I/usr/local/include/python2.7
SOLDFLAGS += -L/usr/local/lib -lpython2.7
else
CPPFLAGS += \
-I/opt/local/include/db4 \
-I/opt/local/include/ncurses \
-I/opt/local/include/python2.4
endif
SOFILE = $(BUILDDIR)/pyspidermonkey.so
all: $(SOFILE)
$(BUILDDIR) $(INSTALLDIRS):
mkdir -p $@
$(OBJECTS): spidermonkey/src/build/libjs.a spidermonkey/src/build/js_operating_system.h
$(SOFILE): $(OBJECTS)
$(LD) $(SOLDFLAGS) $(LDFLAGS) $(OBJECTS) -Lspidermonkey/src/build -ljs -o $@
$(BUILDDIR)/%.o: javascriptlint/pyspidermonkey/%.c | $(BUILDDIR)
$(CC) -o $@ -c $(CFLAGS) $(CPPFLAGS) $<
spidermonkey/src/build/libjs.a:
(cd spidermonkey/src && $(MAKE))
spidermonkey/src/build/js_operating_system.h:
echo "#define XP_UNIX" > $@
clean:
-rm -rf $(BUILDDIR) $(INSTALLDIRS)
-(cd spidermonkey/src && $(MAKE) clean)
install: $(SOFILE) javascriptlint/jsl javascriptlint/jsl | $(INSTALLDIRS)
cp javascriptlint/jsl $(SOFILE) build/install
cp javascriptlint/*.py build/install/javascriptlint
.PHONY: install