diff options
Diffstat (limited to 'recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch')
| -rw-r--r-- | recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch | 429 |
1 files changed, 429 insertions, 0 deletions
diff --git a/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch b/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch new file mode 100644 index 0000000..c5ba270 --- /dev/null +++ b/recipes-devtools/wiringPi/files/0001-Add-initial-cross-compile-support.patch | |||
| @@ -0,0 +1,429 @@ | |||
| 1 | From b0d82bc7cc90db41aa4f7012bbe3009f0b8ab11d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <petter@technux.se> | ||
| 3 | Date: Sat, 18 Jul 2015 23:20:05 +0200 | ||
| 4 | Subject: [PATCH] Add initial cross compile support | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Petter Mabäcker <petter@technux.se> | ||
| 12 | --- | ||
| 13 | devLib/Makefile | 58 +++++++++++++++++++++++++-------------------- | ||
| 14 | examples/Gertboard/Makefile | 22 ++++++++++------- | ||
| 15 | examples/Makefile | 19 +++++++++------ | ||
| 16 | examples/PiFace/Makefile | 22 ++++++++++------- | ||
| 17 | examples/PiGlow/Makefile | 4 ++-- | ||
| 18 | examples/q2w/Makefile | 5 ++-- | ||
| 19 | gpio/Makefile | 31 +++++++++++++----------- | ||
| 20 | wiringPi/Makefile | 56 ++++++++++++++++++++++++------------------- | ||
| 21 | 8 files changed, 124 insertions(+), 93 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/devLib/Makefile b/devLib/Makefile | ||
| 24 | index d62b532..c7c7884 100644 | ||
| 25 | --- a/devLib/Makefile | ||
| 26 | +++ b/devLib/Makefile | ||
| 27 | @@ -22,18 +22,22 @@ | ||
| 28 | ################################################################################# | ||
| 29 | |||
| 30 | VERSION=$(shell cat ../VERSION) | ||
| 31 | -DESTDIR=/usr | ||
| 32 | -PREFIX=/local | ||
| 33 | +DESTDIR?=/usr | ||
| 34 | +PREFIX?=/local | ||
| 35 | |||
| 36 | -STATIC=libwiringPiDev.a | ||
| 37 | -DYNAMIC=libwiringPiDev.so.$(VERSION) | ||
| 38 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 39 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 40 | |||
| 41 | -#DEBUG = -g -O0 | ||
| 42 | -DEBUG = -O2 | ||
| 43 | -CC = gcc | ||
| 44 | -INCLUDE = -I. | ||
| 45 | -DEFS = -D_GNU_SOURCE | ||
| 46 | -CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC | ||
| 47 | +BASE_NAME=libwiringPiDev | ||
| 48 | +STATIC=$(BASE_NAME).a | ||
| 49 | +DYNAMIC=$(BASE_NAME).so.$(VERSION) | ||
| 50 | + | ||
| 51 | +#DEBUG ?= -g -O0 | ||
| 52 | +DEBUG ?= -O2 | ||
| 53 | +CC ?= gcc | ||
| 54 | +INCLUDE ?= -I. | ||
| 55 | +DEFS ?= -D_GNU_SOURCE | ||
| 56 | +CFLAGS ?= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC | ||
| 57 | |||
| 58 | LIBS = | ||
| 59 | |||
| 60 | @@ -60,16 +64,16 @@ $(STATIC): $(OBJ) | ||
| 61 | |||
| 62 | $(DYNAMIC): $(OBJ) | ||
| 63 | @echo "[Link (Dynamic)]" | ||
| 64 | - @$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ) | ||
| 65 | + @$(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ) | ||
| 66 | |||
| 67 | .c.o: | ||
| 68 | @echo [Compile] $< | ||
| 69 | - @$(CC) -c $(CFLAGS) $< -o $@ | ||
| 70 | + @$(CC) -c $(CFLAGS) -fPIC $< -o $@ | ||
| 71 | |||
| 72 | .PHONY: clean | ||
| 73 | clean: | ||
| 74 | @echo "[Clean]" | ||
| 75 | - @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.* | ||
| 76 | + @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak $(BASE_NAME).so* $(BASE_NAME).a | ||
| 77 | |||
| 78 | .PHONY: tags | ||
| 79 | tags: $(SRC) | ||
| 80 | @@ -80,22 +84,22 @@ tags: $(SRC) | ||
| 81 | .PHONY: install | ||
| 82 | install: $(DYNAMIC) | ||
| 83 | @echo "[Install Headers]" | ||
| 84 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 85 | - @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include | ||
| 86 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 87 | + @install -m 0644 $(HEADERS) $(INCLUDE_DIR) | ||
| 88 | @echo "[Install Dynamic Lib]" | ||
| 89 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 90 | - @install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) | ||
| 91 | - @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so | ||
| 92 | - @ldconfig | ||
| 93 | + @install -m 0755 -d $(LIB_DIR) | ||
| 94 | + @install -m 0755 $(BASE_NAME).so $(LIB_DIR)/$(DYNAMIC) | ||
| 95 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so | ||
| 96 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 97 | |||
| 98 | .PHONY: install-static | ||
| 99 | install-static: $(STATIC) | ||
| 100 | @echo "[Install Headers]" | ||
| 101 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 102 | - @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include | ||
| 103 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 104 | + @install -m 0644 $(HEADERS) $(INCLUDE_DIR) | ||
| 105 | @echo "[Install Static Lib]" | ||
| 106 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 107 | - @install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib | ||
| 108 | + @install -m 0755 -d $(LIB_DIR) | ||
| 109 | + @install -m 0644 $(STATIC) $(LIB_DIR) | ||
| 110 | |||
| 111 | .PHONY: install-deb | ||
| 112 | install-deb: $(DYNAMIC) | ||
| 113 | @@ -110,9 +114,11 @@ install-deb: $(DYNAMIC) | ||
| 114 | .PHONY: uninstall | ||
| 115 | uninstall: | ||
| 116 | @echo "[UnInstall]" | ||
| 117 | - @cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS) | ||
| 118 | - @cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPiDev.* | ||
| 119 | - @ldconfig | ||
| 120 | + @cd $(INCLUDE_DIR) && rm -f $(HEADERS) | ||
| 121 | + @rm -f $(LIB_DIR)/$(STATIC) | ||
| 122 | + @rm -f $(LIB_DIR)/$(DYNAMIC) | ||
| 123 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so | ||
| 124 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 125 | |||
| 126 | |||
| 127 | .PHONY: depend | ||
| 128 | diff --git a/examples/Gertboard/Makefile b/examples/Gertboard/Makefile | ||
| 129 | index 7569261..b0c32e0 100644 | ||
| 130 | --- a/examples/Gertboard/Makefile | ||
| 131 | +++ b/examples/Gertboard/Makefile | ||
| 132 | @@ -5,14 +5,20 @@ | ||
| 133 | # Copyright (c) 2013 Gordon Henderson | ||
| 134 | ################################################################################# | ||
| 135 | |||
| 136 | -#DEBUG = -g -O0 | ||
| 137 | -DEBUG = -O3 | ||
| 138 | -CC = gcc | ||
| 139 | -INCLUDE = -I/usr/local/include | ||
| 140 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 141 | - | ||
| 142 | -LDFLAGS = -L/usr/local/lib | ||
| 143 | -LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 144 | +DESTDIR?=/usr | ||
| 145 | +PREFIX?=/local | ||
| 146 | + | ||
| 147 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 148 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 149 | + | ||
| 150 | +#DEBUG ?= -g -O0 | ||
| 151 | +DEBUG ?= -O3 | ||
| 152 | +CC ?= gcc | ||
| 153 | +INCLUDE ?= -I$(INCLUDE_DIR) | ||
| 154 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 155 | + | ||
| 156 | +LDFLAGS ?= -L$(LIB_DIR) | ||
| 157 | +LDLIBS ?= -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 158 | |||
| 159 | # Should not alter anything below this line | ||
| 160 | ############################################################################### | ||
| 161 | diff --git a/examples/Makefile b/examples/Makefile | ||
| 162 | index c9967dc..c2f8b9d 100644 | ||
| 163 | --- a/examples/Makefile | ||
| 164 | +++ b/examples/Makefile | ||
| 165 | @@ -22,15 +22,20 @@ | ||
| 166 | # along with wiringPi. If not, see <http://www.gnu.org/licenses/>. | ||
| 167 | ################################################################################# | ||
| 168 | |||
| 169 | +DESTDIR?=/usr | ||
| 170 | +PREFIX?=/local | ||
| 171 | |||
| 172 | -#DEBUG = -g -O0 | ||
| 173 | -DEBUG = -O3 | ||
| 174 | -CC = gcc | ||
| 175 | -INCLUDE = -I/usr/local/include | ||
| 176 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 177 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 178 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 179 | |||
| 180 | -LDFLAGS = -L/usr/local/lib | ||
| 181 | -LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 182 | +#DEBUG ?= -g -O0 | ||
| 183 | +DEBUG ?= -O3 | ||
| 184 | +CC ?= gcc | ||
| 185 | +INCLUDE ?= -I$(INCLUDE_DIR) | ||
| 186 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 187 | + | ||
| 188 | +LDFLAGS ?= -L$(LIB_DIR) | ||
| 189 | +LDLIBS ?= -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 190 | |||
| 191 | # Should not alter anything below this line | ||
| 192 | ############################################################################### | ||
| 193 | diff --git a/examples/PiFace/Makefile b/examples/PiFace/Makefile | ||
| 194 | index 0bde334..fc14c0c 100644 | ||
| 195 | --- a/examples/PiFace/Makefile | ||
| 196 | +++ b/examples/PiFace/Makefile | ||
| 197 | @@ -23,14 +23,20 @@ | ||
| 198 | ################################################################################# | ||
| 199 | |||
| 200 | |||
| 201 | -#DEBUG = -g -O0 | ||
| 202 | -DEBUG = -O3 | ||
| 203 | -CC = gcc | ||
| 204 | -INCLUDE = -I/usr/local/include | ||
| 205 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 206 | - | ||
| 207 | -LDFLAGS = -L/usr/local/lib | ||
| 208 | -LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 209 | +DESTDIR?=/usr | ||
| 210 | +PREFIX?=/local | ||
| 211 | + | ||
| 212 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 213 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 214 | + | ||
| 215 | +#DEBUG ?= -g -O0 | ||
| 216 | +DEBUG ?= -O3 | ||
| 217 | +CC ?= gcc | ||
| 218 | +INCLUDE ?= -I$(INCLUDE_DIR) | ||
| 219 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 220 | + | ||
| 221 | +LDFLAGS ?= -L$(LIB_DIR) | ||
| 222 | +LDLIBS ?= -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 223 | |||
| 224 | # Should not alter anything below this line | ||
| 225 | ############################################################################### | ||
| 226 | diff --git a/examples/PiGlow/Makefile b/examples/PiGlow/Makefile | ||
| 227 | index 8d31141..482c9e7 100644 | ||
| 228 | --- a/examples/PiGlow/Makefile | ||
| 229 | +++ b/examples/PiGlow/Makefile | ||
| 230 | @@ -26,10 +26,10 @@ | ||
| 231 | #DEBUG = -g -O0 | ||
| 232 | DEBUG = -O3 | ||
| 233 | CC = gcc | ||
| 234 | -INCLUDE = -I/usr/local/include | ||
| 235 | +INCLUDE = -I../wiringPi -I../wiringPiDev | ||
| 236 | CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 237 | |||
| 238 | -LDFLAGS = -L/usr/local/lib | ||
| 239 | +LDFLAGS = -L../wiringPi -L../wiringPiDev | ||
| 240 | LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 241 | |||
| 242 | # Should not alter anything below this line | ||
| 243 | diff --git a/examples/q2w/Makefile b/examples/q2w/Makefile | ||
| 244 | index 150c825..0544aa3 100644 | ||
| 245 | --- a/examples/q2w/Makefile | ||
| 246 | +++ b/examples/q2w/Makefile | ||
| 247 | @@ -22,14 +22,13 @@ | ||
| 248 | # along with wiringPi. If not, see <http://www.gnu.org/licenses/>. | ||
| 249 | ################################################################################# | ||
| 250 | |||
| 251 | - | ||
| 252 | #DEBUG = -g -O0 | ||
| 253 | DEBUG = -O3 | ||
| 254 | CC = gcc | ||
| 255 | -INCLUDE = -I/usr/local/include | ||
| 256 | +INCLUDE = -I../wiringPi -I../devLib | ||
| 257 | CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 258 | |||
| 259 | -LDFLAGS = -L/usr/local/lib | ||
| 260 | +LDFLAGS = -L../wiringPi -L../devLib | ||
| 261 | LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 262 | |||
| 263 | ############################################################################### | ||
| 264 | diff --git a/gpio/Makefile b/gpio/Makefile | ||
| 265 | index 449986e..95af1ad 100644 | ||
| 266 | --- a/gpio/Makefile | ||
| 267 | +++ b/gpio/Makefile | ||
| 268 | @@ -23,16 +23,20 @@ | ||
| 269 | # along with wiringPi. If not, see <http://www.gnu.org/licenses/>. | ||
| 270 | ################################################################################# | ||
| 271 | |||
| 272 | -DESTDIR=/usr | ||
| 273 | -PREFIX=/local | ||
| 274 | +DESTDIR?=/usr | ||
| 275 | +PREFIX?=/local | ||
| 276 | |||
| 277 | -#DEBUG = -g -O0 | ||
| 278 | -DEBUG = -O2 | ||
| 279 | -CC = gcc | ||
| 280 | -INCLUDE = -I$(DESTDIR)$(PREFIX)/include | ||
| 281 | -CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 282 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 283 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 284 | +BIN_DIR?=$(DESTDIR)$(PREFIX)/bin | ||
| 285 | |||
| 286 | -LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib | ||
| 287 | +#DEBUG ?= -g -O0 | ||
| 288 | +DEBUG ?= -O2 | ||
| 289 | +CC ?= gcc | ||
| 290 | +INCLUDE ?= -I$(INCLUDE_DIR) | ||
| 291 | +CFLAGS ?= $(DEBUG) -Wall $(INCLUDE) -Winline -pipe | ||
| 292 | + | ||
| 293 | +LDFLAGS = -L$(LIB_DIR) | ||
| 294 | LIBS = -lwiringPi -lwiringPiDev -lpthread -lm | ||
| 295 | |||
| 296 | # May not need to alter anything below this line | ||
| 297 | @@ -68,11 +72,10 @@ tags: $(SRC) | ||
| 298 | .PHONY: install | ||
| 299 | install: gpio | ||
| 300 | @echo "[Install]" | ||
| 301 | - @cp gpio $(DESTDIR)$(PREFIX)/bin | ||
| 302 | - @chown root.root $(DESTDIR)$(PREFIX)/bin/gpio | ||
| 303 | - @chmod 4755 $(DESTDIR)$(PREFIX)/bin/gpio | ||
| 304 | - @mkdir -p $(DESTDIR)$(PREFIX)/man/man1 | ||
| 305 | - @cp gpio.1 $(DESTDIR)$(PREFIX)/man/man1 | ||
| 306 | + @install -d $(BIN_DIR) | ||
| 307 | + @install -m 4755 -o root -g root gpio $(BIN_DIR) | ||
| 308 | + @install -d $(DESTDIR)$(PREFIX)/share/man/man1 | ||
| 309 | + @install -m 644 -o root -g root gpio.1 $(DESTDIR)$(PREFIX)/share/man/man1 | ||
| 310 | |||
| 311 | .PHONY: install-deb | ||
| 312 | install-deb: gpio | ||
| 313 | @@ -83,7 +86,7 @@ install-deb: gpio | ||
| 314 | .PHONY: uninstall | ||
| 315 | uninstall: | ||
| 316 | @echo "[UnInstall]" | ||
| 317 | - @rm -f $(DESTDIR)$(PREFIX)/bin/gpio | ||
| 318 | + @rm -f $(BIN_DIR)/gpio | ||
| 319 | @rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1 | ||
| 320 | |||
| 321 | .PHONY: depend | ||
| 322 | diff --git a/wiringPi/Makefile b/wiringPi/Makefile | ||
| 323 | index 015a894..5fc0659 100644 | ||
| 324 | --- a/wiringPi/Makefile | ||
| 325 | +++ b/wiringPi/Makefile | ||
| 326 | @@ -22,18 +22,22 @@ | ||
| 327 | ################################################################################# | ||
| 328 | |||
| 329 | VERSION=$(shell cat ../VERSION) | ||
| 330 | -DESTDIR=/usr | ||
| 331 | -PREFIX=/local | ||
| 332 | +DESTDIR?=/usr | ||
| 333 | +PREFIX?=/local | ||
| 334 | +INCLUDE_DIR?=$(DESTDIR)$(PREFIX)/include | ||
| 335 | +LIB_DIR?=$(DESTDIR)$(PREFIX)/lib | ||
| 336 | |||
| 337 | -STATIC=libwiringPi.a | ||
| 338 | -DYNAMIC=libwiringPi.so.$(VERSION) | ||
| 339 | +BASE_NAME=libwiringPi | ||
| 340 | +STATIC=$(BASE_NAME).a | ||
| 341 | +DYNAMIC=$(BASE_NAME).so.$(VERSION) | ||
| 342 | |||
| 343 | -#DEBUG = -g -O0 | ||
| 344 | -DEBUG = -O2 | ||
| 345 | -CC = gcc | ||
| 346 | -INCLUDE = -I. | ||
| 347 | -DEFS = -D_GNU_SOURCE | ||
| 348 | +#DEBUG ?= -g -O0 | ||
| 349 | CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC | ||
| 350 | +DEBUG ?= -O2 | ||
| 351 | +CC ?= gcc | ||
| 352 | +DEFS = -D_GNU_SOURCE | ||
| 353 | +INCLUDE ?= -I. | ||
| 354 | +CFLAGS ?= $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC | ||
| 355 | |||
| 356 | LIBS = | ||
| 357 | |||
| 358 | @@ -83,17 +87,17 @@ $(STATIC): $(OBJ) | ||
| 359 | |||
| 360 | $(DYNAMIC): $(OBJ) | ||
| 361 | @echo "[Link (Dynamic)]" | ||
| 362 | - @$(CC) -shared -Wl,-soname,libwiringPi.so -o libwiringPi.so.$(VERSION) -lpthread $(OBJ) | ||
| 363 | + @$(CC) -shared -Wl,-soname,$(BASE_NAME).so.$(DYN_VERS_MAJ) -o $(BASE_NAME).so -lpthread $(OBJ) | ||
| 364 | |||
| 365 | .c.o: | ||
| 366 | @echo [Compile] $< | ||
| 367 | - @$(CC) -c $(CFLAGS) $< -o $@ | ||
| 368 | + @$(CC) -c $(CFLAGS) -fPIC $< -o $@ | ||
| 369 | |||
| 370 | |||
| 371 | .PHONY: clean | ||
| 372 | clean: | ||
| 373 | @echo "[Clean]" | ||
| 374 | - @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPi.* | ||
| 375 | + @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak $(BASE_NAME).so* $(BASE_NAME).a | ||
| 376 | |||
| 377 | .PHONY: tags | ||
| 378 | tags: $(SRC) | ||
| 379 | @@ -104,22 +108,22 @@ tags: $(SRC) | ||
| 380 | .PHONY: install | ||
| 381 | install: $(DYNAMIC) | ||
| 382 | @echo "[Install Headers]" | ||
| 383 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 384 | - @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include | ||
| 385 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 386 | + @install -m 0644 $(HEADERS) $(INCLUDE_DIR) | ||
| 387 | @echo "[Install Dynamic Lib]" | ||
| 388 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 389 | - @install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) | ||
| 390 | - @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so | ||
| 391 | - @ldconfig | ||
| 392 | + @install -m 0755 -d $(LIB_DIR) | ||
| 393 | + @install -m 0755 $(BASE_NAME).so $(LIB_DIR)/$(DYNAMIC) | ||
| 394 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so | ||
| 395 | + @ln -sf $(DYNAMIC) $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 396 | |||
| 397 | .PHONY: install-static | ||
| 398 | install-static: $(STATIC) | ||
| 399 | @echo "[Install Headers]" | ||
| 400 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/include | ||
| 401 | - @install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include | ||
| 402 | + @install -m 0755 -d $(INCLUDE_DIR) | ||
| 403 | + @install -m 0644 $(HEADERS) $(INCLUDE_DIR) | ||
| 404 | @echo "[Install Static Lib]" | ||
| 405 | - @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib | ||
| 406 | - @install -m 0755 libwiringPi.a $(DESTDIR)$(PREFIX)/lib | ||
| 407 | + @install -m 0755 -d $(LIB_DIR) | ||
| 408 | + @install -m 0644 $(STATIC) $(LIB_DIR) | ||
| 409 | |||
| 410 | .PHONY: install-deb | ||
| 411 | install-deb: $(DYNAMIC) | ||
| 412 | @@ -134,9 +138,11 @@ install-deb: $(DYNAMIC) | ||
| 413 | .PHONY: uninstall | ||
| 414 | uninstall: | ||
| 415 | @echo "[UnInstall]" | ||
| 416 | - @cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS) | ||
| 417 | - @cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPi.* | ||
| 418 | - @ldconfig | ||
| 419 | + @cd $(INCLUDE_DIR) && rm -f $(HEADERS) | ||
| 420 | + @rm -f $(LIB_DIR)/$(STATIC) | ||
| 421 | + @rm -f $(LIB_DIR)/$(DYNAMIC) | ||
| 422 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so | ||
| 423 | + @rm -f $(LIB_DIR)/$(BASE_NAME).so.$(DYN_VERS_MAJ) | ||
| 424 | |||
| 425 | |||
| 426 | .PHONY: depend | ||
| 427 | -- | ||
| 428 | 1.9.1 | ||
| 429 | |||
