I have a question:
I'm creating a library like this:
myLibrary.h
class MyLibrary{
public:
MyLibrary(int);
private:
int myInt;
}
myLibrary.cpp
#include "myLibrary.h"
MyLibrary::MyLibrary(int i){
this->myInt = i;
}
main.cpp
#include "myLibrary.h"
int main(){
MyLibrary library(10);
}
If i now do my Makefile like this:
all:
g++ -o library.o -c myLibrary.cpp
g++ -o main.o -c main.cpp
g++ -o main.out main.o library.o
everything works, but how do I make it, when I provide this library to someone else to use it in his code, he only has to type in his program #include "myLibrary.h" and that's it. So I don't want to make him type all the g++ calls for every c++ file in my library in his makefile, is there a way to include a makefile into an other makefile or something?
I know it might sound like a stupid question, but it would be very gently if you could help me.