summaryrefslogtreecommitdiff
blob: cb92d0ab8d30e8d7a38a9b9398cbeebbb15e74d4 (plain)
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
diff --git a/Makefile.sharedlibrary b/Makefile.sharedlibrary
index 156ea96..a0997b1 100644
--- a/Makefile.sharedlibrary
+++ b/Makefile.sharedlibrary
@@ -52,7 +52,7 @@ INSTALL_PREFIX = /usr/local
 DUKTAPE_SRCDIR = ./src
 #DUKTAPE_SRCDIR = ./src-noline
 
-CC = gcc
+CC ?= gcc
 
 .PHONY: all
 all: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX)
@@ -62,11 +62,11 @@ all: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX)
 # to $INSTALL_PREFIX/include on installation.
 
 libduktape.$(SO_REALNAME_SUFFIX):
-	$(CC) -shared -fPIC -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktape.$(SO_SONAME_SUFFIX) \
+	$(CC) -shared -fPIC ${CFLAGS} ${LDFLAGS} -Wl,$(LD_SONAME_ARG),libduktape.$(SO_SONAME_SUFFIX) -lm \
 		-o $@ $(DUKTAPE_SRCDIR)/duktape.c
 
 libduktaped.$(SO_REALNAME_SUFFIX):
-	$(CC) -shared -fPIC -g -Wall -Wextra -Os -Wl,$(LD_SONAME_ARG),libduktaped.$(SO_SONAME_SUFFIX) \
+	$(CC) -shared -fPIC ${CFLAGS} ${LDFLAGS}  -Wl,$(LD_SONAME_ARG),libduktaped.$(SO_SONAME_SUFFIX) -lm \
 		-o $@ $(DUKTAPE_SRCDIR)/duktape.c
 
 # Symlinks depend on platform conventions.
@@ -85,4 +85,4 @@ install: libduktape.$(SO_REALNAME_SUFFIX) libduktaped.$(SO_REALNAME_SUFFIX)
 
 CCOPTS = -I./examples/cmdline
 duk:
-	$(CC) $(CCOPTS) -I$(INSTALL_PREFIX)/include -L$(INSTALL_PREFIX)/lib -Wall -Wextra -Os -o $@ ./examples/cmdline/duk_cmdline.c -lduktape -lm
+	$(CC) $(CCOPTS) -I$(INSTALL_PREFIX)/include -L$(INSTALL_PREFIX)/lib ${CFLAGS} -o $@ ./examples/cmdline/duk_cmdline.c -lduktape -lm