summaryrefslogtreecommitdiff
blob: c621c8dc90a452ca31de8c0c814a383aebaa67d1 (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
diff -ur a/Makefile b/Makefile
--- a/Makefile	2010-01-01 17:04:05.082926765 -0500
+++ b/Makefile	2010-01-01 17:17:27.232927324 -0500
@@ -7,9 +7,10 @@
 ################
 
 c     := $(compiler)
-cpp   := $(subst cc,++,$(compiler))
-flags := -O3 -fomit-frame-pointer -Ilib
-link  :=
+cpp   ?= $(subst cc,++,$(compiler))
+flags := $(CXXFLAGS) -Ilib
+cflags := $(CFLAGS) -Ilib
+link  := $(LDFLAGS)
 
 # profile-guided instrumentation:
 # flags += -fprofile-generate
@@ -24,6 +25,7 @@
 
 ifeq ($(platform),x)
   link += -s
+  link += -ldl `pkg-config --libs x11 xext`
 
   ruby := video.glx video.xv video.qtraster video.sdl
   ruby += audio.alsa audio.openal audio.oss audio.pulseaudio audio.ao
@@ -90,7 +92,7 @@
 compile = \
   $(strip \
     $(if $(filter %.c,$<), \
-      $(c) $(flags) $1 -c $< -o $@, \
+      $(c) $(cflags) $1 -c $< -o $@, \
       $(if $(filter %.cpp,$<), \
         $(cpp) $(flags) $1 -c $< -o $@ \
       ) \