瀏覽代碼

add options for cross compiling

pull/62/head
Nico Bollen 5 年之前
父節點
當前提交
7171aba5e4
共有 4 個文件被更改,包括 53 次插入5 次删除
  1. +14
    -2
      devLib/Makefile
  2. +13
    -1
      gpio/Makefile
  3. +13
    -1
      wiringPi/Makefile
  4. +13
    -1
      wiringPiD/Makefile

+ 14
- 2
devLib/Makefile 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存