Add npm libs
This commit is contained in:
parent
2fe2f93abc
commit
5e0e1caef3
@ -1,6 +1,6 @@
|
|||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
COMMON_FLAGS = -W -Wall -Wno-unused-parameter -Ipxtapp -fwrapv -fno-threadsafe-statics -Os -mthumb
|
COMMON_FLAGS = -W -Wall -Wno-unused-parameter -Ipxtapp -fwrapv -fno-threadsafe-statics -Os -mthumb $(NPM_INCLUDES)
|
||||||
CFLAGS = $(COMMON_FLAGS) -std=c99
|
CFLAGS = $(COMMON_FLAGS) -std=c99
|
||||||
CXXFLAGS = $(COMMON_FLAGS) -std=c++11 -fno-rtti -fno-exceptions -fno-unwind-tables
|
CXXFLAGS = $(COMMON_FLAGS) -std=c++11 -fno-rtti -fno-exceptions -fno-unwind-tables
|
||||||
LDFLAGS = -Wl,--gc-sections -Wl,--sort-common -Wl,--sort-section=alignment
|
LDFLAGS = -Wl,--gc-sections -Wl,--sort-common -Wl,--sort-section=alignment
|
||||||
@ -8,6 +8,8 @@ PREF = arm-linux-gnueabi-
|
|||||||
CC = $(PREF)gcc
|
CC = $(PREF)gcc
|
||||||
LD = $(PREF)gcc
|
LD = $(PREF)gcc
|
||||||
LIBSTDCPP = /usr/lib/gcc/arm-linux-gnueabi/4.9/libstdc++.a
|
LIBSTDCPP = /usr/lib/gcc/arm-linux-gnueabi/4.9/libstdc++.a
|
||||||
|
NPM_LIBS = $(wildcard node_modules/*/lib/*.a)
|
||||||
|
NPM_INCLUDES = $(addprefix -I, $(wildcard node_modules/*/include))
|
||||||
|
|
||||||
EXE = bld/pxt-app.elf
|
EXE = bld/pxt-app.elf
|
||||||
HEX = $(EXE:.elf=.hex)
|
HEX = $(EXE:.elf=.hex)
|
||||||
@ -17,7 +19,7 @@ DEPS = $(PXT_HEADERS) package.json Makefile Makefile.inc
|
|||||||
all: $(EXE)
|
all: $(EXE)
|
||||||
|
|
||||||
$(EXE): $(PXT_OBJS)
|
$(EXE): $(PXT_OBJS)
|
||||||
$(LD) -o $(EXE) $(LDFLAGS) -Wl,-Map,$(EXE:.elf=.map) $(PXT_OBJS) $(LIBSTDCPP) -lm
|
$(LD) -o $(EXE) $(LDFLAGS) -Wl,-Map,$(EXE:.elf=.map) $(PXT_OBJS) $(LIBSTDCPP) -lm $(NPM_LIBS)
|
||||||
cp $(EXE) $(EXE:.elf=.full)
|
cp $(EXE) $(EXE:.elf=.full)
|
||||||
$(PREF)strip $(EXE)
|
$(PREF)strip $(EXE)
|
||||||
node -p 'require("fs").readFileSync("$(EXE)").toString("hex")' > $(HEX)
|
node -p 'require("fs").readFileSync("$(EXE)").toString("hex")' > $(HEX)
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
"testFiles": [
|
"testFiles": [
|
||||||
"test.ts"
|
"test.ts"
|
||||||
],
|
],
|
||||||
|
"npmDependencies": {
|
||||||
|
"pxt-linux-ev3-api": "1.0.0",
|
||||||
|
"pxt-linux-pth": "2.0.7"
|
||||||
|
},
|
||||||
"public": true,
|
"public": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"base": "file:../base"
|
"base": "file:../base"
|
||||||
|
Loading…
Reference in New Issue
Block a user