Created
December 13, 2012 16:16
-
-
Save uhziel/4277550 to your computer and use it in GitHub Desktop.
test c macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
#ifdef FOO | |
printf("hello\n"); | |
#endif | |
#ifndef BAR | |
printf("world\n"); | |
#endif | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
gcc -g -o DFOO_UBAR0 main.c -DFOO | |
gcc -g -o DFOO_UBAR1 main.c -DFOO=1 | |
gcc -g -o DFOO_UBAR2 main.c -DFOO=0 | |
gcc -g -o DFOO_DBAR main.c -DFOO -DBAR | |
gcc -g -o UFOO_DBAR main.c -DBAR | |
gcc -g -o UFOO_UBAR1 main.c | |
gcc -g -o UFOO_UBAR2 main.c -DFOO=1 -UFOO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment