1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/build_system_cflags_spaces/main.c
Gaëtan Harter d6b109f720
tests/build_system_cflags_spaces: test CFLAGS macros handling
This tests passing CFLAGS with spaces to an application and also that
even if the CFLAGS are defined after Makefile.include, they trigger
a rebuild when modified.

This includes an example how to pass macros with spaces to a docker
build.

The test as both an automated part for the CFLAGS with spaces, and a
manual part for the two other features.
2019-09-27 19:29:07 +02:00

38 lines
917 B
C

/*
* Copyright (C) 2019 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup tests
* @{
*
* @file
* @brief Test the CFLAGS handling
*
* @author Gaëtan Harter <gaetan.harter@fu-berlin.de>
*
* @}
*/
#include <stdio.h>
/* Define a CFLAGS string with spaces from outside docker */
/* DOCKER_ENVIRONMENT_CMDLINE=$'-e CFLAGS=-DSTRING_FROM_DOCKER=\'\\\"with\ space\\\"\''*/
#ifndef STRING_FROM_DOCKER
#define STRING_FROM_DOCKER ""
#endif
int main(void)
{
puts("The output of the configuration variables:");
printf("SUPER_STRING: %s\n", SUPER_STRING);
printf("DEFINED_AFTER_MAKEFILE_INCLUDE: %u\n", DEFINED_AFTER_MAKEFILE_INCLUDE);
printf("CFLAGS_STRING_FROM_DOCKER: %s\n", STRING_FROM_DOCKER);
return 0;
}