summarylogtreecommitdiffstats
path: root/simplify-makefile.patch
blob: 580a2a2b8983a6b0134fd3b87755c65939ce0b93 (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
72
73
--- a/Makefile
+++ b/Makefile
@@ -1,42 +1,29 @@
--include ../../Make.config
-
-all: i686 x86_64 mipsel ppc db2 sh4 mipsel15 ipkg
-
-i686:
-	$(MAKE) -C build/i686 all
-	
-x86_64:
-	$(MAKE) -C build/x86_64 all
-	
-ppc: 	
-	$(MAKE) -C build/ppc
-
-db2: 	
-	$(MAKE) -C build/db2
-
-mipsel: 	
-	$(MAKE) -C build/mipsel all
-
-mipsel15:         
-	$(MAKE) -C build/mipsel15
-	
-sh4:         
-	$(MAKE) -C build/sh4 all
-
-ipkg:   mipsel
-	$(MAKE) -C pkgs ipkg
-    	
-arm:         
-	$(MAKE) -C build/arm
-
-	
+LOCVER := $(shell hg id | tr ' ' / )
+MODFLAG := $(shell if `hg status | grep ^M | grep \.[ch]$$ > /dev/null` ; then echo /dirty ; fi )
+
+CFLAGS += -fPIC -DHAVE_DVB_API_VERSION=5 $(DBGFLAGS)
+LDFLAGS += -lpthread -lrt
+DRIVER = vtuner-dvb-3
+
+default: vtunerd vtunerc
+
+vtuner-dvb-3.o: vtuner-dvb-3.c vtuner-dvb-3.h
+	$(CC) $(CFLAGS) -c -o vtuner-dvb-3.o vtuner-dvb-3.c
+
+vtunerd: vtunerd.c vtunerd-service.o vtuner-network.o vtuner-utils.o $(DRIVER).o
+	$(CC) $(CFLAGS) -DBUILDVER="\"$(LOCVER)\"" -DMODFLAG=\"$(MODFLAG)\" -o vtunerd vtuner-network.o vtunerd-service.o $(DRIVER).o vtuner-utils.o vtunerd.c $(LDFLAGS)
+
+vtunerc: vtunerc.c vtuner-network.o vtuner-utils.o
+	$(CC) $(CFLAGS) -DBUILDVER="\"$(LOCVER)\"" -DMODFLAG=\"$(MODFLAG)\" -o vtunerc vtuner-network.o vtuner-utils.o vtunerc.c $(LDFLAGS)
+
+vtunerd-service.o: vtunerd-service.c vtunerd-service.h
+	$(CC) $(CFLAGS) -c -o vtunerd-service.o vtunerd-service.c
+
+vtuner-network.o: vtuner-network.c vtuner-network.h
+	$(CC) $(CFLAGS) -c -o vtuner-network.o vtuner-network.c
+
+vtuner-utils.o: vtuner-utils.c vtuner-utils.h
+	$(CC) $(CFLAGS) -c -o vtuner-utils.o vtuner-utils.c
+
 clean:
-	$(MAKE) -C build/i686 clean
-	$(MAKE) -C build/x86_64 clean
-	$(MAKE) -C build/ppc clean
-	$(MAKE) -C build/db2 clean
-	$(MAKE) -C build/mipsel clean
-	$(MAKE) -C build/sh4 clean
-	$(MAKE) -C build/mipsel15 clean
-	$(MAKE) -C pkgs clean
-	$(MAKE) -C build/arm clean
+	rm -rf *.o vtunerd vtunerc