Skip to content

Commit 9085764

Browse files
committed
Merge pull request #29 from stelgenhof/newmake
Updated Makefile for RPi 3 support
2 parents d0bbe13 + e18b7c7 commit 9085764

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

Makefile

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,24 @@ TTY_GROUPNAME := tty
1515
CC=g++
1616
# get PI Revision from cpuinfo
1717
PIREV := $(shell cat /proc/cpuinfo | grep Revision | cut -f 2 -d ":" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$$//')
18-
CCFLAGS=-Wall -Ofast -mfpu=vfp -lpthread -g -D__Raspberry_Pi -mfloat-abi=hard -mtune=arm1176jzf-s -D_TTY_NAME=\"${TTY_NAME}\" -D_TTY_GROUPNAME=\"${TTY_GROUPNAME}\"
19-
20-
ifeq (${PIREV},$(filter ${PIREV},a01041 a21041))
21-
# a01041 and a21041 are PI 2 Model B and armv7
22-
CCFLAGS += -march=armv7-a
18+
CCFLAGS=-Wall -Ofast -lpthread -g -D__Raspberry_Pi -mfloat-abi=hard -D_TTY_NAME=\"${TTY_NAME}\" -D_TTY_GROUPNAME=\"${TTY_GROUPNAME}\"
19+
20+
ifeq (${PIREV}, $(filter ${PIREV}, a02082))
21+
# a02082 is PI 3 Model B (ARM Cortex A53)
22+
CCFLAGS += -march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8
23+
else ifeq (${PIREV}, $(filter ${PIREV}, a01041 a21041))
24+
# a01041 and a21041 are PI 2 Model B (Arm Cortex A7)
25+
CCFLAGS += -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4
2326
else
2427
# anything else is armv6
25-
CCFLAGS += -march=armv6zk
28+
CCFLAGS += -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp
2629
endif
2730

28-
ifeq (${PIREV},$(filter ${PIREV},a01041 a21041 0010))
31+
ifeq (${PIREV}, $(filter ${PIREV}, a01041 a21041 0010 a02082))
2932
# a01041 and a21041 are PI 2 Model B with BPLUS Layout and 0010 is Pi Model B+ with BPLUS Layout
33+
# a02082 is PI 3 Model B (ARM Cortex A53)
3034
CCFLAGS += -D__PI_BPLUS
31-
endif
35+
endif
3236

3337
# define all programs
3438
PROGRAMS = MyGateway MySensor MyMessage PiEEPROM
@@ -67,14 +71,14 @@ clean:
6771

6872
install: all install-gatewayserial install-gateway install-initscripts
6973

70-
install-gatewayserial:
74+
install-gatewayserial:
7175
@echo "Installing ${GATEWAY_SERIAL} to ${BINDIR}"
7276
@install -m 0755 ${GATEWAY_SERIAL} ${BINDIR}
7377

74-
install-gateway:
78+
install-gateway:
7579
@echo "Installing ${GATEWAY} to ${BINDIR}"
7680
@install -m 0755 ${GATEWAY} ${BINDIR}
77-
81+
7882
install-initscripts:
7983
@echo "Installing initscripts to /etc/init.d"
8084
@install -m 0755 initscripts/PiGatewaySerial /etc/init.d
@@ -86,21 +90,20 @@ install-initscripts:
8690

8791
enable-gw: install
8892
@update-rc.d PiGateway defaults
89-
93+
9094
enable-gwserial: install
9195
@update-rc.d PiGatewaySerial defaults
92-
96+
9397
remove-gw:
9498
@update-rc.d -f PiGateway remove
95-
99+
96100
remove-gwserial:
97101
@update-rc.d -f PiGatewaySerial remove
98-
102+
99103
uninstall: remove-gw remove-gwserial
100104
@echo "Stopping daemon PiGatewaySerial (ignore errors)"
101105
-@service PiGatewaySerial stop
102106
@echo "Stopping daemon PiGateway (ignore errors)"
103107
-@service PiGateway stop
104108
@echo "removing files"
105109
rm ${BINDIR}/PiGatewaySerial ${BINDIR}/PiGateway /etc/init.d/PiGatewaySerial /etc/init.d/PiGateway /etc/rsyslog.d/30-PiGatewaySerial.conf /etc/rsyslog.d/30-PiGateway.conf
106-

0 commit comments

Comments
 (0)