aboutsummaryrefslogtreecommitdiff
path: root/libnxt/SConstruct
blob: 3020c854bc2f6a8328efbaa5e8b8b85bc2326b81 (plain)
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
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.Command('flash_routine.h',
		 ['flash_routine.h.base',
		  'flash_write/flash.bin'],
		 './make_flash_header.py flash_write/flash.bin')

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

Default(BuildEnv.Program('fwflash', glob('main_fwflash.c'),
			 LIBS=['usb', 'nxt'], LIBPATH='.fwexec', glob('main_fwexec.c'),
		 LIBS=['usb', 'nxt'], LIBPATH='.', 'nxt'], LIBPATH='.'))
BuildEnv.Program('sambaget', glob('main_sambaget.c'),
		 LIBS=['usb',