summaryrefslogtreecommitdiff
blob: cce51d79febcc434c8e441340fe4971b65faee66 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff --git a/Makefile b/Makefile
index daa54d7..1163a8d 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ STRIP=strip
 # External image lib to use: imagemagick, graphicsmagick, imlib2 or none
 IMAGELIB = imagemagick
 
+#
 
 # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING
 # -------------------------------------------------------------
@@ -29,13 +30,18 @@ VERSION = $(shell grep 'const char \*cText2SkinPlugin::VERSION *=' $(PLUGIN).c |
 ### The C++ compiler and options:
 
 CXX      ?= g++
-CXXFLAGS ?= -fPIC -Wall -Woverloaded-virtual
+ifdef DEBUG
+CXXFLAGS ?= -Wall -Woverloaded-virtual
+else
+CXXFLAGS ?= -Wall -Woverloaded-virtual -O3
+endif
+CXXFLAGS += -fPIC
 
 ### The directory environment:
 
-VDRDIR = ../../..
-LIBDIR = ../../lib
-TMPDIR = /tmp
+VDRDIR ?= ../../..
+LIBDIR ?= ../../lib
+TMPDIR ?= /tmp
 
 ### Make sure that necessary options are included (VDR >= 1.7.13):
 
@@ -88,8 +94,7 @@ endif
 ifdef DEBUG
 	CXXFLAGS += -g -fno-inline
 	DEFINES += -DDEBUG
-else
-	CXXFLAGS += -O3
+	STRIP=
 ifdef BENCH
 	DEFINES += -DBENCH
 endif
@@ -118,7 +123,7 @@ $(DEPFILE): Makefile
 -include $(DEPFILE)
 
 ### Internationalization (I18N):
-
+#
 PODIR     = po
 LOCALEDIR = $(VDRDIR)/locale
 I18Npo    = $(notdir $(wildcard $(PODIR)/*.po))
@@ -134,6 +139,7 @@ $(I18Npot): $(wildcard *.c)
 $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.po
 	@mkdir -p $(dir $@)
 	msgfmt -c -o $@ $<
+#
 
 .PHONY: i18n
 i18n: $(I18Npo:%.po=$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo)
@@ -143,7 +149,7 @@ i18n: $(I18Npo:%.po=$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo)
 libvdr-$(PLUGIN).so: $(OBJS)
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
 	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
-ifndef DEBUG
+ifdef STRIP
 	$(STRIP) $(LIBDIR)/$@.$(APIVERSION)
 endif