aboutsummaryrefslogtreecommitdiff
path: root/ham/direwolf/Makefile.patch
blob: e58ef7271cbb738ac669cc9d67c25906b7a7094f (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
--- Makefile.linux	2014-04-13 22:13:06.000000000 -0500
+++ Makefile.linux.fixed	2014-07-22 22:39:30.875648118 -0500
@@ -4,8 +4,26 @@
 
 all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients
 
-CC = gcc
+CC ?= gcc
+INSTALL ?= sudo install
+INSTALL_PROGRAM = $(INSTALL) -m 755
+INSTALL_DATA = $(INSTALL) -m 644
+INSTALL_DIR = $(INSTALL) -d
+
+prefix ?= /usr/local
+exec_prefix = $(prefix)
+bindir ?= $(exec_prefix)/bin
+docdir ?= $(prefix)/share/doc/direwolf
+datadir ?= $(prefix)/share/direwolf
+appdir ?= /usr/share/applications
+sysconfdir ?= ~
+LINK_IN_HOME ?= yes
 
+ifeq ($(LINK_IN_HOME),yes)
+	HOME_DESKTOP = ln -f -s /usr/share/applications/direwolf.desktop ~/Desktop/direwolf.desktop
+else
+	HOME_DESKTOP = 
+endif
 #
 # The DSP filters can be sped up considerably with the SSE 
 # instructions.  The SSE instructions were introduced in 1999 
@@ -78,12 +96,14 @@
 # cause compatibility issues for those with older computers.
 #
 
-arch := $(shell echo | gcc -E -dM - | grep __i386__)
+arch ?= $(shell echo | gcc -E -dM - | grep __i386__)
 
+ifndef CFLAGS
 ifneq ($(arch),)
-CFLAGS := -DUSE_ALSA -O3 -march=pentium3 -pthread
+	CFLAGS := -DUSE_ALSA -O3 -march=pentium3 -pthread
 else
-CFLAGS := -DUSE_ALSA -O3 -pthread
+	CFLAGS := -DUSE_ALSA -O3 -pthread
+endif
 endif
 
 
@@ -131,37 +151,40 @@
 LatLong-UTMconversion.o : utm/LatLong-UTMconversion.c
 	$(CC) $(CFLAGS) -c -o $@ $^
 
-
 # Optional install step. 
 # TODO: Review file locations.
 # TODO: Handle Linux variations correctly.
 # The Raspberry Pi has ~/Desktop but Ubuntu does not.
 # For now, just put reference to it at the end so only last step fails.
 
-install : direwolf decode_aprs tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png direwolf.desktop
-	sudo install direwolf /usr/local/bin
-	sudo install decode_aprs /usr/local/bin
-	sudo install text2tt /usr/local/bin
-	sudo install tt2text /usr/local/bin
-	sudo install ll2utm /usr/local/bin
-	sudo install utm2ll /usr/local/bin
-	sudo install aclients /usr/local/bin
-	sudo install -D --mode=644 tocalls.txt /usr/share/direwolf/tocalls.txt
-	sudo install -D --mode=644 symbols-new.txt /usr/share/direwolf/symbols-new.txt
-	sudo install -D --mode=644 symbolsX.txt /usr/share/direwolf/symbolsX.txt
-	sudo install -D --mode=644 dw-icon.png /usr/share/direwolf/dw-icon.png
-	sudo install -D --mode=644 direwolf.desktop /usr/share/applications/direwolf.desktop
-	cp direwolf.conf ~
-	cp dw-start.sh ~
-	sudo install -D --mode=644 CHANGES.txt /usr/local/share/doc/direwolf/CHANGES.txt
-	sudo install -D --mode=644 LICENSE-dire-wolf.txt /usr/local/share/doc/direwolf/LICENSE-dire-wolf.txt
-	sudo install -D --mode=644 LICENSE-other.txt /usr/local/share/doc/direwolf/LICENSE-other.txt
-	sudo install -D --mode=644 User-Guide.pdf /usr/local/share/doc/direwolf/User-Guide.pdf
-	sudo install -D --mode=644 Raspberry-Pi-APRS.pdf /usr/local/share/doc/direwolf/Raspberry-Pi-APRS.pdf
-	sudo install -D --mode=644 APRStt-Implementation-Notes.pdf /usr/local/share/doc/direwolf/APRStt-Implementation-Notes.pdf
-	sudo install -D --mode=644 Quick-Start-Guide-Windows.pdf /usr/local/share/doc/direwolf/Quick-Start-Guide-Windows.pdf
-	ln -f -s /usr/share/applications/direwolf.desktop ~/Desktop/direwolf.desktop
-
+install : direwolf decode_aprs tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png direwolf.desktop 
+	$(INSTALL_DIR) $(DESTDIR)$(bindir)/
+	$(INSTALL_PROGRAM) direwolf $(DESTDIR)$(bindir)/
+	$(INSTALL_PROGRAM) decode_aprs $(DESTDIR)$(bindir)/
+	$(INSTALL_PROGRAM) text2tt $(DESTDIR)$(bindir)/
+	$(INSTALL_PROGRAM) tt2text $(DESTDIR)$(bindir)/
+	$(INSTALL_PROGRAM) ll2utm $(DESTDIR)$(bindir)/
+	$(INSTALL_PROGRAM) utm2ll $(DESTDIR)$(bindir)/
+	$(INSTALL_PROGRAM) aclients $(DESTDIR)$(bindir)/
+	$(INSTALL_DIR) $(DESTDIR)$(datadir)
+	$(INSTALL_DATA) tocalls.txt $(DESTDIR)$(datadir)/
+	$(INSTALL_DATA) symbols-new.txt $(DESTDIR)$(datadir)/
+	$(INSTALL_DATA) symbolsX.txt $(DESTDIR)$(datadir)/
+	$(INSTALL_DATA) dw-icon.png $(DESTDIR)$(datadir)/
+	$(INSTALL_DIR) $(DESTDIR)$(appdir)
+	$(INSTALL_DATA) direwolf.desktop $(DESTDIR)$(appdir)/
+	$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)
+	$(INSTALL_DATA) direwolf.conf $(DESTDIR)$(sysconfdir)/
+	$(INSTALL_DATA) dw-start.sh $(DESTDIR)$(sysconfdir)/
+	$(INSTALL_DIR) $(DESTDIR)$(docdir)
+	$(INSTALL_DATA) CHANGES.txt $(DESTDIR)$(docdir)/
+	$(INSTALL_DATA) LICENSE-dire-wolf.txt $(DESTDIR)$(docdir)/
+	$(INSTALL_DATA) LICENSE-other.txt $(DESTDIR)$(docdir)/
+	$(INSTALL_DATA) User-Guide.pdf $(DESTDIR)$(docdir)/
+	$(INSTALL_DATA) Raspberry-Pi-APRS.pdf $(DESTDIR)$(docdir)/
+	$(INSTALL_DATA) APRStt-Implementation-Notes.pdf $(DESTDIR)$(docdir)/
+	$(INSTALL_DATA) Quick-Start-Guide-Windows.pdf $(DESTDIR)$(docdir)/
+	$(HOME_DESKTOP)
 
 # Separate application to decode raw data.