forked from ve3wwg/raspberry_pi2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.incl
More file actions
31 lines (25 loc) · 914 Bytes
/
Makefile.incl
File metadata and controls
31 lines (25 loc) · 914 Bytes
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
######################################################################
# librpi2/Makefile.incl
#
# Exploring the Raspberry Pi 2 with C++ (ISBN 978-1-4842-1738-2)
# by Warren Gay VE3WWG
# LGPL2 V2.1
######################################################################
TOPDIR := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
CXX = $(shell ls /usr/bin/g++-*|tail -1)
CXXSTD ?= c++11
#
# LINUX4X is set to -DLINUX4X if uname -r returns a release other than the older 3.X
#
KVER = $$(expr `uname -r` : '^\([0-9]*\)')
LINUX4X = $(shell if [ $(KVER) -ne 3 ] ; then echo "-DLINUX4X" ; fi)
PREFIX ?= /usr/local
LINUX ?= /home/pi/linux
AR ?= ar
INCL ?= -I. -I$(TOPDIR)/include
CXXFLAGS ?= -std=$(CXXSTD) $(LINUX4X) -Wall -Wno-deprecated -Wno-narrowing $(INCL)
OPTZ ?= -g -O0
LDFLAGS ?= -L$(TOPDIR)/lib -lrpi2 -lrt -lm
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(OPTZ) $< -o $*.o
# End Makefile