makefile - How do I change output of C program without editing it? -
makefile - How do I change output of C program without editing it? -
this question has reply here:
replace #define x macro value 1 specified in compilation command 1 reply how can edit executable during compiling, without changing source? [duplicate] 2 answersi have c programme not allowed edit looks this:
#include <stdio.h> #ifndef year #define year "2013" #endif int main(){ printf("hello world " year "\n"); homecoming 0; } i need create makefile compile programme , alter year 2014, output "hello world 2014" without editing c program. how can this?
the compilation command should start gcc -wall -dyear='"2014"'. code makefile suitable cflags settings. this answer should inspirational.
c makefile
Comments
Post a Comment