Skip to content

Instantly share code, notes, and snippets.

@yeputons
Created March 25, 2014 18:28
Show Gist options
  • Save yeputons/9768113 to your computer and use it in GitHub Desktop.
Save yeputons/9768113 to your computer and use it in GitHub Desktop.
#include <cstdio>
#include "message.h"
void foo();
int main() {
printf("main: %s\n", MESSAGE);
foo();
return 0;
}
#include <cstdio>
#include "message.h"
void foo() {
printf("foo: %s\n", MESSAGE);
}
all: main.exe
main.exe
main.exe: a.o b.o
g++ -o $@ $^
%.o: %.cpp
g++ -o $@ -c $<
a.cpp: message.h
b.cpp: message.h
namespace {
const char* MESSAGE = "WORLD";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment