summaryrefslogtreecommitdiff
blob: 7d33b681fdcdc61d81690bc94644515f78bded22 (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
34
35
36
diff -ur a/Makefile b/Makefile
--- a/Makefile	2009-12-08 02:46:37.000000000 -0500
+++ b/Makefile	2010-01-01 22:09:35.594592128 -0500
@@ -1,9 +1,11 @@
 include nall/Makefile
 
 c     := $(compiler)
-cpp   := $(subst cc,++,$(compiler))
-flags := -O3 -fomit-frame-pointer -I. -Icommon -Ilibgambatte/include -Ilibgambatte/src
-link  :=
+cpp   ?= $(subst cc,++,$(compiler))
+flags := $(CXXFLAGS) -I. -Icommon -Ilibgambatte/include -Ilibgambatte/src
+cflags := $(CFLAGS) -I. -Icommon -Ilibgambatte/include -Ilibgambatte/src
+link  := $(LDFLAGS)
+ar    ?= ar
 
 ifeq ($(platform),osx)
   flags := -fPIC $(flags)
@@ -24,7 +26,7 @@
 compile = \
   $(strip \
     $(if $(filter %.c,$<), \
-      $(c) $(flags) $1 -c $< -o $@, \
+      $(c) $(cflags) $1 -c $< -o $@, \
       $(if $(filter %.cpp,$<), \
         $(cpp) $(flags) $1 -c $< -o $@ \
       ) \
@@ -105,7 +107,7 @@
 	ar rcs libsupergameboy.a $(objects)
 	$(cpp) $(link) -o libsupergameboy.dylib -shared -dynamiclib $(objects) $(qtlib)
 else
-	ar rcs libsupergameboy.a $(objects)
+	$(ar) rcs libsupergameboy.a $(objects)
 	$(cpp) $(link) -o libsupergameboy.so -shared -Wl,-soname,libsupergameboy.so.1 $(objects) $(qtlib)
 endif