• Zhangjin Wu's avatar
    selftests/nolibc: allow test -include /path/to/nolibc.h · 850fad7d
    Zhangjin Wu authored
    As the head comment of nolibc-test.c shows, it can be built in 3 ways:
    
        $(CC) -nostdlib -include /path/to/nolibc.h => NOLIBC already defined
        $(CC) -nostdlib -I/path/to/nolibc/sysroot  => _NOLIBC_* guards are present
        $(CC) with default libc                    => NOLIBC* never defined
    
    Only last two of them are tested currently, let's allow test the first one too.
    
    This may help to find issues about using nolibc.h to build programs. it
    derives from this change:
    
        commit 3a8039e2
    
     ("tools/nolibc: Fix build of stdio.h due to header ordering")
    
    Usage:
    
        // test with sysroot by default
        $ make run-user
    
        // test without sysroot, using nolibc.h directly
        $ make run-user NOLIBC_SYSROOT=0
    Signed-off-by: default avatarZhangjin Wu <falcon@tinylab.org>
    Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
    850fad7d
Makefile 7.06 KB