Skip to content

Instantly share code, notes, and snippets.

@rnapier
Last active Dec 18, 2015
Embed
What would you like to do?
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