Skip to content

Instantly share code, notes, and snippets.

@catalan42
Last active December 18, 2015 12:49
Show Gist options
  • Save catalan42/5785177 to your computer and use it in GitHub Desktop.
Save catalan42/5785177 to your computer and use it in GitHub Desktop.
Sample code to demonstrate make dependencies using the "touch" command.
//------------------------------------------------------------
// dog.cpp
//
#include <iostream>
#include "dogSays.h"
using namespace std;
int main() {
cout << " dog says: " << dogSays() << endl;
}
//------------------------------------------------------------
// dogSays.cpp
//
#include "dogSound.h"
#include "dogSays.h"
using namespace std;
StrType dogSays( void ) {
StrType result = dogSound;
return result;
}
//------------------------------------------------------------
// dogSays.h
//
#include <string>
#include "strType.h"
using namespace std;
StrType dogSays( void );
//------------------------------------------------------------
// dogSound.h
//
#define dogSound (char*)"bark"
//------------------------------------------------------------
// strType.h
//
#define StrType char*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment