Skip to content

Instantly share code, notes, and snippets.

@rnapier
Last active December 18, 2015 02:19
Show Gist options
  • Save rnapier/5710509 to your computer and use it in GitHub Desktop.
Save rnapier/5710509 to your computer and use it in GitHub Desktop.
void A() {}
void A();
void Aprime();
void Aprime() {}
#include "a.h"
void B() {
Aprime();
}
void B();
all: test
testa: source.o libA.a libB.a
g++ source.cpp -o test libA.a libB.a
testb:
g++ source.cpp -o test libB.a libA.a
libA.a: a.o aprime.o
ar -r libA.a a.o aprime.o
libB.a: b.o
ar -r libB.a b.o
clean:
rm -f *.o test *.a
#include "a.h"
#include "b.h"
int main (int argc, char const *argv[])
{
A();
B();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment