Skip to content
Commits on Source (5)
......@@ -29,13 +29,6 @@ GCCMAJOR := $(echo __GNUC__ | $compiler -E -xc - | tail -n 1)
GCCMINOR := $(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
GCCVER := $(shell printf "%02d%02d" $(GCCMAJOR) $(GCCMINOR))
JSDIR = $(DEPTH)mozjs/installroot
JSOBJ = $(JSDIR)/usr/lib/libmozjs-17.0.a
JSFLAGS = \
-include $(JSDIR)/usr/include/js-17.0/js/RequiredDefines.h \
-I/usr/include/nspr \
-I$(JSDIR)/usr/include/js-17.0
WARNINGS = \
-Wall \
-Wshadow \
......@@ -77,7 +70,7 @@ else
MWLDFLAGS += -O0
endif
MWCFLAGS = -std=gnu99 -pedantic -g $(DEFS) $(JSFLAGS) $(CCSEC) $(WARNINGS)
MWCFLAGS = -std=gnu99 -pedantic -g $(DEFS) $(CCSEC) $(WARNINGS)
ifneq ($(RELEASE_BUILD),0)
MWCFLAGS += -O2
# This requires optimisation so add it here instead of CCSEC
......
SRCROOT = $(CURDIR)/..
DEPTH=../
include $(DEPTH)Makefile.common
build: duktape.o
duktape.o: duktape.c duktape.h duk_config.h
$(CC) -std=c99 $(CCSEC) duktape.c -c
clean:
-rm -f *.o .*.d *.d
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,11 +2,35 @@ SRCROOT = $(CURDIR)/../..
DEPTH=../../
include ../../Makefile.common
# Build with `make JSENGINE=foo` to switch engines
JSENGINE ?= moz
JSDIR_moz = $(DEPTH)mozjs
JSOBJ_moz = $(JSDIR_moz)/installroot/usr/lib/libmozjs-17.0.a
JSFLAGS_moz = \
-include $(JSDIR_moz)/installroot/usr/include/js-17.0/js/RequiredDefines.h \
-I/usr/include/nspr \
-I$(JSDIR_moz)/installroot/usr/include/js-17.0
JSDIR_duk = $(DEPTH)duktape
JSOBJ_duk = $(JSDIR_duk)/duktape.o
JSFLAGS_duk = -I$(JSDIR_duk)
JSDIR = $(JSDIR_$(JSENGINE))
JSOBJ = $(JSOBJ_$(JSENGINE))
JSFLAGS = $(JSFLAGS_$(JSENGINE))
LDLIBS+= -lreadline -ltermcap -lcrypt -lsqlite3 -lcurl -lpthread -lcrypto -ljansson -lz -lm
CFLAGS+= -I..
CFLAGS+= -I.. $(JSFLAGS)
build: mw
$(JSOBJ):
$(MAKE) -C $(JSDIR)
# Ugly hack to only build the required js implementation
CODE := $(filter-out js-%.c, $(CODE)) js-$(JSENGINE).c
mw: $(CODE:.c=.o) ../libmw.a $(JSOBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
......
#include <stdio.h>
#include <duktape.h>
#include "js.h"
int js_isrunning(void)
{
return 0;
}
int js_exec(char *name, int argc, const char **argvc)
{
return 0;
}
int load_jsfile(FILE *f, const char *filename)
{
return 0;
}
int is_js(char *name)
{
return 0;
}
void js_stop_execution(void)
{
}
int stop_js(void)
{
return 0;
}
int setup_js(void)
{
return 0;
}
size_t urldata(void *ptr, size_t size, size_t nmemb, void *stream)
{
return 0;
}
size_t headlimit(void *ptr, size_t size, size_t nmemb, void *stream)
{
return 0;
}
......@@ -2,7 +2,6 @@
#define JS_H
#include <stdio.h>
#include <jsapi.h>
int js_isrunning(void);
int js_exec(char *name, int argc, const char **argvc);
......
......@@ -7,7 +7,7 @@ LDLIBS+= -ljansson -lsqlite3
build: mwserv
mwserv: $(CODE:.c=.o) ../libmw.a $(JSOBJ)
mwserv: $(CODE:.c=.o) ../libmw.a
$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^
clean:
......