view helpers/build-date.c @ 671:5f00e9afd5d9

removing clutter: INIT_blob provision The lost init.c source was reconstructed from init.obj in 2017; prior to that reconstruction we were compiling main.lib from partial source: using the init module in blob form with various binary patches, but recompiling create_RVtasks.c from source so we could change RiViera SWE configuration. We've been using the fully reconstructed version of init.c since 2017, and now the old INIT_blob provision (which is not used by any config) is just extra noise in our targets/*.conf files. This commit removes all bits related to this provision, reducing clutter and making it easier to add new targets.
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 29 May 2020 02:36:39 +0000
parents adf7a4281fd7
children
line wrap: on
line source

/*
 * This program runs at firmware build time to produce a C file for the
 * fw build that includes the build date and time stamp.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <time.h>

main(argc, argv)
	char **argv;
{
	time_t now;
	struct tm *tm;

	if (argc < 2 || argc > 4) {
		fprintf(stderr,
			"usage: %s config_name target_name src_version\n",
			argv[0]);
		exit(1);
	}
	time(&now);
	tm = gmtime(&now);
	printf("const char firmware_version_str[] =\n");
	if (argc >= 3)
		printf("\"FreeCalypso Magnetite %s (%s), ", argv[1], argv[2]);
	else
		printf("\"FreeCalypso Magnetite %s, ", argv[1]);
	if (argc >= 4 && strcmp(argv[3], "unknown"))
		printf("source version %s, ", argv[3]);
	printf("build date %d-%02d-%02dT%02d:%02d:%02dZ\";\n",
		tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
		tm->tm_hour, tm->tm_min, tm->tm_sec);
	exit(0);
}