Browse Source

add options for cross compiling

pull/62/head
Nico Bollen 5 years ago
parent
commit
7171aba5e4
4 changed files with 53 additions and 5 deletions
  1. +14
    -2
      devLib/Makefile
  2. +13
    -1
      gpio/Makefile
  3. +13
    -1
      wiringPi/Makefile
  4. +13
    -1
      wiringPiD/Makefile

+ 14
- 2
devLib/Makefile View File

@@ -36,8 +36,20 @@ DYNAMIC=libwiringPiDev.so.$(VERSION)

#DEBUG = -g -O0
DEBUG = -O2
CC = gcc
INCLUDE = -I.

GCC_ARCH := $(shell gcc -dumpmachine)

ifeq ($(OS),Windows_NT)
CROSS_COMPILE ?= arm-linux-gnueabihf-
else
ifneq ($(GCC_ARCH),arm-linux-gnueabihf)
CROSS_COMPILE ?= arm-linux-gnueabihf-
endif
endif

CC = $(CROSS_COMPILE)gcc

INCLUDE = -I. -I/usr/local/include
DEFS = -D_GNU_SOURCE
CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC



+ 13
- 1
gpio/Makefile View File

@@ -32,7 +32,19 @@ endif

#DEBUG = -g -O0
DEBUG = -O2
CC = gcc

GCC_ARCH := $(shell gcc -dumpmachine)

ifeq ($(OS),Windows_NT)
CROSS_COMPILE ?= arm-linux-gnueabihf-
else
ifneq ($(GCC_ARCH),arm-linux-gnueabihf)
CROSS_COMPILE ?= arm-linux-gnueabihf-
endif
endif

CC = $(CROSS_COMPILE)gcc

INCLUDE = -I$(DESTDIR)$(PREFIX)/include
CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe



+ 13
- 1
wiringPi/Makefile View File

@@ -36,7 +36,19 @@ DYNAMIC=libwiringPi.so.$(VERSION)

#DEBUG = -g -O0
DEBUG = -O2
CC = gcc

GCC_ARCH := $(shell gcc -dumpmachine)

ifeq ($(OS),Windows_NT)
CROSS_COMPILE ?= arm-linux-gnueabihf-
else
ifneq ($(GCC_ARCH),arm-linux-gnueabihf)
CROSS_COMPILE ?= arm-linux-gnueabihf-
endif
endif

CC = $(CROSS_COMPILE)gcc

INCLUDE = -I.
DEFS = -D_GNU_SOURCE
CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Wextra -Winline $(INCLUDE) -pipe -fPIC


+ 13
- 1
wiringPiD/Makefile View File

@@ -31,7 +31,19 @@ endif

#DEBUG = -g -O0
DEBUG = -O2
CC = gcc

GCC_ARCH := $(shell gcc -dumpmachine)

ifeq ($(OS),Windows_NT)
CROSS_COMPILE ?= arm-linux-gnueabihf-
else
ifneq ($(GCC_ARCH),arm-linux-gnueabihf)
CROSS_COMPILE ?= arm-linux-gnueabihf-
endif
endif

CC = $(CROSS_COMPILE)gcc

INCLUDE = -I$(DESTDIR)$(PREFIX)/include
CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe



Loading…
Cancel
Save