summaryrefslogtreecommitdiff
blob: b7a83aa4924607804643e816fc2ef7acfe27c8f1 (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
--- Makefile
+++ Makefile
@@ -1,13 +1,14 @@
 CC = gcc
-CPP = g++
-LD = $(CPP)
-LDFLAGS = `sdl-config --libs` `xml2-config --libs` -lSDL_image -lSDL_ttf -lm -lxml2 -rdynamic -ljpeg -ldl
+CXX = g++
+LD = $(CC)
+LDFLAGS += $(shell sdl-config --libs) $(shell xml2-config --libs) -lSDL_image -lSDL_ttf -lm -lxml2 -ljpeg -ldl -lpng
 PROG = SDLcam
 
-FEATURES = -DMMX -DTIMER
+CPPFLAGS = -DMMX -DTIMER -DPROG_VERSION=\"0.7.3\"
 
-MMXFLAGS =     -Wshadow -Wall -Wstrict-prototypes `sdl-config --cflags` `xml2-config --cflags` -DPROG_VERSION=\"0.7.3\" $(FEATURES)
-CFLAGS = $(MMXFLAGS) -g
+MMXFLAGS =     -Wshadow -Wall $(shell sdl-config --cflags) $(shell xml2-config --cflags)
+CFLAGS += $(MMXFLAGS) $(CPPFLAGS) -Wstrict-prototypes
+CXXFLAGS += $(MMXFLAGS) $(CPPFLAGS)
 
 
 OBJS = main.o init.o SDL_v4l.o SDL_v4l_filters.o webcam.o interface.o configuration.o config_file.o SDL_v4l_filters_thomas.o dump_thomas.o capture.o ftp-upload.o logo.o parser.o misc.o xml_theme.o dyn_misc.o
@@ -31,32 +32,30 @@
 	./install
 
 %.o: %.cpp
-	$(CC) $(CFLAGS) -c $<
+	$(CXX) $(CXXFLAGS) -c $<
 
 %.o: %.c
-	$(CPP) $(CFLAGS) -c $<
+	$(CC) $(CFLAGS) -c $<
 
 sources/%.so: sources/%.cpp
-	$(CPP) $(FEATURES) -g -fPIC -shared -o $@ $?
+	$(CXX) $(CXXFLAGS) -fPIC -shared -o $@ $? $(LDFLAGS)
 
 sources/jpeg.so: sources/jpeg.cpp
-	$(CPP) $(FEATURES) -g -fPIC -shared -o $@ $? -ljpeg
+	$(CXX) $(CXXFLAGS) -fPIC -shared -o $@ $? -ljpeg $(LDFLAGS)
 
 filter/%.so: filter/%.c
-	$(CC) $(FEATURES) -g -fPIC -shared -o $@ $?
+	$(CC) $(CFLAGS) -fPIC -shared -o $@ $? $(LDFLAGS)
 
 capture/mpeg.so: capture/mpeg.c
-	- $(CC) $(FEATURES) -g -fPIC -shared -o $@ $? -lfame
+	$(CC) $(CFLAGS) -fPIC -shared -o $@ $? -lfame $(LDFLAGS)
 
 capture/divx.so: capture/divx.c
-	- $(CC) $(FEATURES) -g -fPIC -shared -o $@ $? -ldivxencore
+	$(CC) $(CFLAGS) -fPIC -shared -o $@ $? -ldivxencore $(LDFLAGS)
 
 capture/divx2.so: capture/divx2.cpp
-	- $(CPP) $(FEATURES) -g -fPIC -shared -o $@ $?
+	$(CXX) $(CXXFLAGS) -fPIC -shared -o $@ $? $(LDFLAGS)
 
 SDLcam: $(OBJS)
-	$(LD) $(LDFLAGS) $(OBJS) -o $(PROG) 
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o $(PROG) 
 #	$(LD) $(LDFLAGS) $(OBJS) -o $(PROG) -laviplay
 
-SDL_v4l_filters_thomas.o: SDL_v4l_filters_thomas.c
-	$(CC) $(MMXFLAGS) -c SDL_v4l_filters_thomas.c