summaryrefslogtreecommitdiff
path: root/media-gfx/apngopt/files/apngopt-1.4-r1-makefile.patch
blob: 0726f81db4a21c84fee359f684d2719f4f073791 (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
Use system zopfli library and respect CFLAGS.

--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,9 @@
 PACKAGE    = apngopt
-CC         = gcc
-SRC_DIRS   = . 7z zopfli
-CFLAGS     = -Wall -pedantic
-CFLAGS_OPT = -O2
-CFLAGS_7Z  = -Wno-sign-compare -Wno-reorder -Wno-maybe-uninitialized -Wno-parentheses
-LIBS       = -lstdc++ -lm -lpng -lz
+
+SRC_DIRS   = . 7z
+CXXFLAGS   += -Wall -pedantic
+CXXFLAGS_7Z = -Wno-sign-compare -Wno-reorder -Wno-maybe-uninitialized -Wno-parentheses
+LIBS       += -lm -lpng -lz -lzopfli
 
 INCUDE_DIRS := $(addprefix -I./, $(SRC_DIRS))
 OBJ_DIRS := $(addprefix obj/, $(SRC_DIRS))
@@ -16,19 +15,16 @@
 all : $(PACKAGE)
 
 $(PACKAGE) : objdirs $(OBJECTS)
-	$(CC) -o $@ $(OBJECTS) -s $(LIBS)
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
 
 objdirs :
 	mkdir -p $(OBJ_DIRS)
 
 obj/%.o : %.cpp
-	$(CC) -o $@ -c $< $(INCUDE_DIRS) $(CFLAGS) $(CFLAGS_OPT)
-
-obj/%.o : %.c
-	$(CC) -o $@ -c $< $(INCUDE_DIRS) $(CFLAGS) $(CFLAGS_OPT)
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $< $(INCUDE_DIRS)
 
 obj/%.o : %.cc
-	$(CC) -o $@ -c $< $(INCUDE_DIRS) $(CFLAGS) $(CFLAGS_OPT) $(CFLAGS_7Z)
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $< $(INCUDE_DIRS) $(CXXFLAGS_7Z)
 
 .PHONY : clean