Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
84
Issues
84
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
e422bcb9
Commit
e422bcb9
authored
Feb 25, 2019
by
baujc
Committed by
Adam Wujek
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in Kconfig the selection of the optimization compilation flags
parent
7c80fe3b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
7 deletions
+79
-7
Kconfig
Kconfig
+34
-0
Makefile
userspace/libsdb/Makefile
+7
-1
Makefile
userspace/libwr/Makefile
+8
-2
Makefile
userspace/tools/Makefile
+8
-1
Makefile
userspace/wrs_watchdog/Makefile
+7
-1
Makefile
userspace/wrsw_hal/Makefile
+8
-1
Makefile
userspace/wrsw_rtud/Makefile
+7
-1
No files found.
Kconfig
View file @
e422bcb9
...
...
@@ -1064,3 +1064,37 @@ config RTU_HP_MASK_VAL
endmenu
source Kconfig_vlans.in
choice
prompt "Compilation optimization"
config OPTIMIZATION_SPEED
boolean "Execution time (-O2)"
help
GCC performs nearly all supported optimizations that do not involve a space-speed tradeoff.
config OPTIMIZATION_SIZE_SPEED
boolean "Size and execution time (-Os)"
help
Optimize for size. Enables all -O2 optimizations except those that often increase code size.
config OPTIMIZATION_DEBUGGING
boolean "Debugging (-Og -ggdb)"
help
Should be the optimization level of choice for the standard edit-compile-debug cycle
config OPTIMIZATION_NONE_DEBUGGING
boolean "Debugging without optimization(-ggdb)"
help
Compile without optimization and with debug informations
endchoice
config OPTIMIZATION
string
default "-Os" if OPTIMIZATION_SIZE_SPEED
default "-O2" if OPTIMIZATION_SPEED
default "-Og -ggdb" if OPTIMIZATION_DEBUGGING
default "-ggdb" if OPTIMIZATION_NONE_DEBUGGING
default ""
userspace/libsdb/Makefile
View file @
e422bcb9
# We are now Kconfig-based
-include
../../.config
LINUX
?=
/lib/modules/
$(
shell
uname
-r
)
/build
# If we compile for the kernel, we need to include real kernel headers.
...
...
@@ -19,7 +22,10 @@ OBJDUMP = $(CROSS_COMPILE)objdump
# calculate endianness at compile time
ENDIAN
:=
$(
shell
./check-endian
$(CC))
CFLAGS
=
-Wall
-ggdb
-O2
export
CFLAGS_OPTIMIZATION
:=
${
shell
echo
$(CONFIG_OPTIMIZATION)
}
CFLAGS
+=
$(CFLAGS_OPTIMIZATION)
CFLAGS
+=
-Wall
CFLAGS
+=
-I
../include/linux
-I
../include
# for <sdb.h>
CFLAGS
+=
-ffunction-sections
-fdata-sections
CFLAGS
+=
-Wno-pointer-sign
...
...
userspace/libwr/Makefile
View file @
e422bcb9
# We are now Kconfig-based
-include
../../.config
OBJS
=
init.o fpga_io.o util.o pps_gen.o i2c.o shw_io.o i2c_bitbang.o
\
i2c_fpga_reg.o pio.o libshw_i2c.o i2c_sfp.o fan.o i2c_io.o hwiu.o
\
ptpd_netif.o hal_client.o hal_minirpc.o
\
...
...
@@ -21,8 +25,10 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY
=
$(CROSS_COMPILE)
objcopy
OBJDUMP
=
$(CROSS_COMPILE)
objdump
CFLAGS
=
-Wall
-I
.
-O2
-ggdb
\
-Wstrict-prototypes
\
export
CFLAGS_OPTIMIZATION
:=
${
shell
echo
$(CONFIG_OPTIMIZATION)
}
CFLAGS
+=
$(CFLAGS_OPTIMIZATION)
CFLAGS
+=
-Wall
-I
.
-Wstrict-prototypes
\
-DLIBWR_INTERNAL
\
-I
./include
\
-I
../include
\
...
...
userspace/tools/Makefile
View file @
e422bcb9
# We are now Kconfig-based
-include
../../.config
TOOLS
=
rtu_stat wr_mon wr_phytool wrs_pps_control spll_dbg_proxy load-lm32 load-virtex com
TOOLS
+=
mapper wmapper
TOOLS
+=
wrs_version wr_date lm32-vuart wrs_pstats
...
...
@@ -28,7 +32,10 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP
=
$(CROSS_COMPILE)
objdump
# LOTs of includes
CFLAGS
=
-O2
-g
-Wall
\
export
CFLAGS_OPTIMIZATION
:=
${
shell
echo
$(CONFIG_OPTIMIZATION)
}
CFLAGS
+=
$(CFLAGS_OPTIMIZATION)
CFLAGS
+=
-Wall
\
-Wstrict-prototypes
\
-I
$(LINUX)
/arch/arm/mach-at91/include
\
-I
../wrsw_rtud
\
...
...
userspace/wrs_watchdog/Makefile
View file @
e422bcb9
# We are now Kconfig-based
-include
../../.config
OBJS
=
wrs_watchdog.o
BINARY
=
wrs_watchdog
...
...
@@ -16,7 +19,10 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY
=
$(CROSS_COMPILE)
objcopy
OBJDUMP
=
$(CROSS_COMPILE)
objdump
CFLAGS
=
-O
-g
-Wall
\
export
CFLAGS_OPTIMIZATION
:=
${
shell
echo
$(CONFIG_OPTIMIZATION)
}
CFLAGS
+=
$(CFLAGS_OPTIMIZATION)
CFLAGS
=
-Wall
\
-Wstrict-prototypes
\
-I
../include
\
-I
../libwr/include
\
...
...
userspace/wrsw_hal/Makefile
View file @
e422bcb9
# We are now Kconfig-based
-include
../../.config
OBJS
=
hal_exports.o hal_main.o hal_ports.o hal_timing.o
BINARY
=
wrsw_hal
...
...
@@ -16,7 +19,10 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY
=
$(CROSS_COMPILE)
objcopy
OBJDUMP
=
$(CROSS_COMPILE)
objdump
CFLAGS
=
-O
-g
-Wall
\
export
CFLAGS_OPTIMIZATION
:=
${
shell
echo
$(CONFIG_OPTIMIZATION)
}
CFLAGS
+=
$(CFLAGS_OPTIMIZATION)
CFLAGS
+=
-Wall
\
-Wstrict-prototypes
\
-I
../include
\
-I
../libwr/include
\
...
...
@@ -34,6 +40,7 @@ LDFLAGS = -L../libwr -L../mini-rpc \
all
:
$(BINARY)
$(BINARY)
:
$(OBJS)
pwd
$(CC)
-o
$@
$^
$(LDFLAGS)
install
:
all
...
...
userspace/wrsw_rtud/Makefile
View file @
e422bcb9
# We are now Kconfig-based
-include
../../.config
PROGRAM
=
wrsw_rtud
SRCFILES
=
rtu_drv.c rtu_ext_drv.c rtu_hash.c rtu_fd.c rtud.c
\
rtud_exports.c utils.c
...
...
@@ -17,7 +20,10 @@ STRIP = $(CROSS_COMPILE)strip
OBJCOPY
=
$(CROSS_COMPILE)
objcopy
OBJDUMP
=
$(CROSS_COMPILE)
objdump
CFLAGS
=
-O2
-Wall
-ggdb
\
export
CFLAGS_OPTIMIZATION
:=
${
shell
echo
$(CONFIG_OPTIMIZATION)
}
CFLAGS
+=
$(CFLAGS_OPTIMIZATION)
CFLAGS
=
-Wall
\
-Wstrict-prototypes
\
-I
../mini-rpc
\
-I
../include
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment