File: SConstruct

package info (click to toggle)
libnxt 0.3-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 216 kB
  • ctags: 100
  • sloc: ansic: 647; python: 69; makefile: 21; xml: 17; asm: 8
file content (35 lines) | stat: -rw-r--r-- 949 bytes parent folder | download | duplicates (4)
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
32
33
34
35
from glob import glob

auto_libs = ''

# Detect the system's endianness
from sys import byteorder
if byteorder == 'big':
	endian = '_NXT_BIG_ENDIAN'
else:
	endian = '_NXT_LITTLE_ENDIAN'

BuildEnv = Environment(CCFLAGS=['-Wall', '-std=gnu99',
				'-g', '-ggdb', '-D' + endian])
if auto_libs:
	BuildEnv.ParseConfig('pkg-config --cflags --libs ' + auto_libs)

BuildEnv.Append(LINKFLAGS='-z relro')
BuildEnv.Append(CCFLAGS=['-g', '-O2', '-fstack-protector', '--param=ssp-buffer-size=4',
			 '-Wformat', '-Werror=format-security', '-D_FORTIFY_SOURCE=2'])

BuildEnv.Command('flash_routine.h',
		 'flash_routine.h.base',
		 './make_flash_header.py')

Default(BuildEnv.Library('nxt',
			 [x for x in glob('*.c')
			  if not x.startswith('main_')],
			 LIBS='usb'))

Default(BuildEnv.Program('fwflash', 'main_fwflash.c',
			 LIBS=['nxt', 'usb'], LIBPATH='.',
			 ))

Default(BuildEnv.Program('fwexec', 'main_fwexec.c',
			 LIBS=['nxt', 'usb'], LIBPATH='.'))