You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.4 KiB

Index: Makefile.cmdline
--- Makefile.cmdline.orig 2022-02-18 22:22:19.000000000 +0100
+++ Makefile.cmdline 2022-03-31 09:25:44.143307000 +0200
@@ -10,9 +10,9 @@
CC ?= gcc
CC := $(CC)
-CCOPTS = -Os -pedantic -std=c99 -Wall -fstrict-aliasing -fomit-frame-pointer
-CCOPTS += -I./examples/cmdline -I./src # duktape.h and duk_config.h must be in include path
-CCLIBS = -lm
+CCOPTS = -std=c99 -fstrict-aliasing -fomit-frame-pointer
+CCOPTS += -I./examples/cmdline -I./src -I$(PREFIX)/include
+CCLIBS= -L$(PREFIX)/lib -lm
# Enable print() and alert() for command line using an optional extra module.
CCOPTS += -DDUK_CMDLINE_PRINTALERT_SUPPORT -I./extras/print-alert
Index: Makefile.library
--- Makefile.library.orig 2022-03-31 22:48:57.436982000 +0200
+++ Makefile.library 2022-03-31 22:48:42.003590000 +0200
@@ -0,0 +1,23 @@
+#
+# Example Makefile for building a program with embedded Duktape.
+# The example program here is the Duktape command line tool.
+#
+
+DUKTAPE_SOURCES = src/duktape.c
+
+CMDLINE_SOURCES = \
+ examples/cmdline/duk_cmdline.c
+
+CC ?= gcc
+CC := $(CC)
+CCOPTS = -std=c99 -fstrict-aliasing -fomit-frame-pointer
+CCOPTS += -I./examples/cmdline -I./src -I$(PREFIX)/include
+CCLIBS=
+
+libduktape.o: $(DUKTAPE_SOURCES)
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $(DEFINES) $(CCOPTS) -c $(DUKTAPE_SOURCES)
+
+libduktape.a: libduktape.o
+ ar rc $@ libduktape.o
+ ranlib $@
+