UDI/udibuild - Added command tracing flag, C99 pedantic in default config
authorJohn Hodge <[email protected]>
Sat, 24 May 2014 15:05:55 +0000 (23:05 +0800)
committerJohn Hodge <[email protected]>
Sat, 24 May 2014 15:05:55 +0000 (23:05 +0800)
UDI/Tools/udibuild.ini
UDI/Tools/udibuild_src/build.c
UDI/Tools/udibuild_src/include/common.h
UDI/Tools/udibuild_src/main.c

index 8c7ca2d..1c5739c 100644 (file)
@@ -1,6 +1,7 @@
 [COMMON]
 
 [ia32]
-CFLAGS=-ffreestanding -I/home/tpg/Projects/GitClones/acess2/UDI/include/ -Wall -Wextra -Wno-unused-parameter -Wswitch-default
+CFLAGS=-ffreestanding -I/home/tpg/Projects/GitClones/acess2/UDI/include/ -Wall -Wextra -Wno-unused-parameter -std=c99 -pedantic
+# -Wc++-compat
 CC=i586-elf-gcc
 LD=i586-elf-ld
index 4d0b294..88f0473 100644 (file)
@@ -40,6 +40,9 @@ int Build_CompileFile(tIniFile *opts, const char *abi, tUdiprops *udiprops, tUdi
                srcfile->CompileOpts ? srcfile->CompileOpts : "",
                srcfile->Filename, objfile);
        printf("--- Compiling: %s\n", srcfile->Filename);
+       if( gbTraceEnabled ) {
+               printf(">> %s\n", cmd);
+       }
         int rv = system(cmd);
        free(cmd);
        free(objfile);
@@ -110,7 +113,9 @@ int Build_LinkObjects(tIniFile *opts, const char *abi, tUdiprops *udiprops)
                abi, udiprops->ModuleName, objfiles_str, udiprops_c
                );
        printf("--- Linking: bin/%s/%s\n", abi, udiprops->ModuleName);
-       printf("%s\n", cmd);
+       if( gbTraceEnabled ) {
+               printf(">> %s\n", cmd);
+       }
        int rv = system(cmd);
        free(cmd);
        free(udiprops_c);
index 0cb419b..2f92913 100644 (file)
@@ -9,6 +9,7 @@
 #define _COMMON_H_
 
 #include <stdarg.h>
+#include <stdbool.h>
 
 #ifndef __GNUC__
 # define __attribute__(...)
@@ -16,5 +17,7 @@
 
 extern char    *mkstr(const char *fmt, ...) __attribute__((format(printf,1,2)));
 
+extern bool    gbTraceEnabled;
+
 #endif
 
index b5b0042..f933cc1 100644 (file)
@@ -29,6 +29,7 @@
 void   Usage(const char *progname);
 
 // === GLOBALS ===
+bool   gbTraceEnabled = false;
 const char *gsRuntimeDir = RUNTIME_DIR;
 const char *gsOpt_ConfigFile;
 const char *gsOpt_WorkingDir;

UCC git Repository :: git.ucc.asn.au