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.
 
 
 
 
 
 

30 lines
1.2 KiB

#
# Example Makefile for building a program with embedded Duktape.
#
# There are two source sets in the distribution: combined sources where
# you only need duktape.c and duktape.h, and separate sources where you
# have a bunch of source and header files. Whichever you use, simply
# include the relevant sources into your C project. This Makefile uses
# the combined source file.
#
DUKTAPE_SOURCES = src/duktape.c
# Compiler options are quite flexible. GCC versions have a significant impact
# on the size of -Os code, e.g. gcc-4.6 is much worse than gcc-4.5.
CC = gcc
CCOPTS = -Os -pedantic -std=c99 -Wall -fstrict-aliasing -fomit-frame-pointer
CCOPTS += -I./src # for combined sources
CCLIBS = -lm
# These should not be needed but you might consider them
#CCOPTS += -m32 # force 32-bit compilation on a 64-bit host
#DEFINES = -DDUK_PROFILE=100 # if omitted, profile defaults to 100 on a
# # 32-bit platform, and 400 otherwise
# For debugging, use -O0 -g -ggdb, and don't add -fomit-frame-pointer
hello: $(DUKTAPE_SOURCES) examples/hello/hello.c
$(CC) -o $@ $(DEFINES) $(CCOPTS) $(DUKTAPE_SOURCES) examples/hello/hello.c $(CCLIBS)