Skip to content

Commit fcdf8be

Browse files
committed
Makefiles
1 parent c9b3aad commit fcdf8be

10 files changed

+131
-0
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
###############################################################################
2+
# CONFIGURE CORE PLATFORM MAKEFILE
3+
# This file is where we make platform and architecture specific
4+
# configurations. This file can be specified for a generic architecture or can
5+
# be defined as variants. For instance, normally this file will be located in
6+
# a platform specific subpath such as
7+
#
8+
# $(OF_ROOT)/libs/openFrameworksComplied/linux64
9+
#
10+
# This file will then be a generic platform file like:
11+
#
12+
# configure.linux64.default.make
13+
#
14+
# Or it can specify a specific platform variant like:
15+
#
16+
# configure.linuxarmv6l.raspberrypi.make
17+
#
18+
################################################################################
19+
20+
################################################################################
21+
# include common rules
22+
#
23+
# all linux systems have several rules in common so most of them are included
24+
# from the following file
25+
#
26+
################################################################################
27+
28+
include $(OF_SHARED_MAKEFILES_PATH)/config.linux.common.mk
29+
30+
31+
################################################################################
32+
# PLATFORM CFLAGS
33+
# This is a list of fully qualified CFLAGS required when compiling for this
34+
# platform. These flags will always be added when compiling a project or the
35+
# core library. These flags are presented to the compiler AFTER the
36+
# PLATFORM_OPTIMIZATION_CFLAGS below.
37+
#
38+
# Note: Leave a leading space when adding list items with the += operator
39+
################################################################################
40+
41+
PLATFORM_LDFLAGS += -no-pie
42+
# PLATFORM_LDFLAGS += -nostartfiles
43+
44+
PLATFORM_CFLAGS += -march=armv8-a
45+
PLATFORM_CFLAGS += -mcpu=cortex-a72
46+
PLATFORM_CFLAGS += -mtune=cortex-a72
47+
# PLATFORM_CFLAGS += -Wall
48+
# PLATFORM_CFLAGS += -Werror
49+
PLATFORM_CFLAGS += -fPIC
50+
PLATFORM_CFLAGS += -ftree-vectorize
51+
PLATFORM_CFLAGS += -Wno-psabi
52+
PLATFORM_CFLAGS += -pipe
53+
54+
################################################################################
55+
# PLATFORM LIBRARIES
56+
# These are library names/paths that are platform specific and are specified
57+
# using names or paths. The library flag (i.e. -l) is prefixed automatically.
58+
#
59+
# PLATFORM_LIBRARIES are libraries that can be found in the library search
60+
# paths.
61+
# PLATFORM_STATIC_LIBRARIES is a list of required static libraries.
62+
# PLATFORM_SHARED_LIBRARIES is a list of required shared libraries.
63+
# PLATFORM_PKG_CONFIG_LIBRARIES is a list of required libraries that are
64+
# under system control and are easily accesible via the package
65+
# configuration utility (i.e. pkg-config)
66+
#
67+
# See the helpfile for the -l flag here for more information:
68+
# http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
69+
#
70+
# Note: Leave a leading space when adding list items with the += operator
71+
################################################################################
72+
73+
PLATFORM_PKG_CONFIG_LIBRARIES += glesv1_cm
74+
PLATFORM_PKG_CONFIG_LIBRARIES += glesv2
75+
PLATFORM_PKG_CONFIG_LIBRARIES += egl
76+
77+
78+
################################################################################
79+
# PLATFORM CORE EXCLUSIONS
80+
# During compilation, these makefiles will generate lists of sources, headers
81+
# and third party libraries to be compiled and linked into a program or core
82+
# library. The PLATFORM_CORE_EXCLUSIONS is a list of fully qualified file
83+
# paths that will be used to exclude matching paths and files during list
84+
# generation.
85+
#
86+
# Each item in the PLATFORM_CORE_EXCLUSIONS list will be treated as a complete
87+
# string unless teh user adds a wildcard (%) operator to match subdirectories.
88+
# GNU make only allows one wildcard for matching. The second wildcard (%) is
89+
# treated literally.
90+
#
91+
# Note: Leave a leading space when adding list items with the += operator
92+
################################################################################
93+
94+
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/sound/ofFmodSoundPlayer.cpp
95+
96+
ifeq ($(CROSS_COMPILING),1)
97+
ifdef MAKEFILE_DEBUG
98+
$(info detected cross compiling $(CROSS_COMPILING))
99+
endif
100+
101+
ifdef GCC_PREFIX
102+
#You have specified GCC_PREFIX with an environment variable
103+
else
104+
GCC_PREFIX = aarch64-linux-gnu
105+
endif
106+
107+
PLATFORM_CXX = /usr/bin/$(GCC_PREFIX)-g++
108+
PLATFORM_CC = /usr/bin/$(GCC_PREFIX)-gcc
109+
PLATFORM_AR = /usr/bin/$(GCC_PREFIX)-ar
110+
PLATFORM_LD = /usr/bin/$(GCC_PREFIX)-ld
111+
112+
SYSROOT=$(RPI_ROOT)
113+
114+
PLATFORM_CFLAGS += --sysroot=$(SYSROOT)
115+
116+
PLATFORM_LIBRARY_SEARCH_PATHS += /usr/lib/$(GCC_PREFIX)
117+
PLATFORM_LIBRARY_SEARCH_PATHS += /lib/$(GCC_PREFIX)
118+
PLATFORM_LIBRARY_SEARCH_PATHS += $(RPI_ROOT)/usr/lib/$(GCC_PREFIX)/blas
119+
PLATFORM_LIBRARY_SEARCH_PATHS += $(RPI_ROOT)/usr/lib/$(GCC_PREFIX)/lapack
120+
121+
PLATFORM_LDFLAGS += --sysroot=$(SYSROOT)
122+
PLATFORM_LDFLAGS += -lblas -llapack
123+
PLATFORM_LDFLAGS += -Xlinker -rpath-link=/usr/lib/$(GCC_PREFIX)
124+
PLATFORM_LDFLAGS += -Xlinker -rpath-link=/lib/$(GCC_PREFIX)
125+
PLATFORM_LDFLAGS += -Xlinker -rpath-link=/usr/lib/$(GCC_PREFIX)/pulseaudio
126+
PLATFORM_LDFLAGS += -Xlinker -rpath-link=$(RPI_ROOT)/usr/lib/$(GCC_PREFIX)/lapack
127+
PLATFORM_LDFLAGS += -Xlinker -rpath-link=$(RPI_ROOT)/usr/lib/$(GCC_PREFIX)/blas
128+
129+
PKG_CONFIG_LIBDIR += /usr/lib/pkgconfig:/usr/lib/$(GCC_PREFIX)/pkgconfig:/usr/share/pkgconfig
130+
131+
endif

0 commit comments

Comments
 (0)