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 answers

i 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

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

SQL Server : need assitance parsing delimted data and returning a long concatenated string -