Skip to content

Instantly share code, notes, and snippets.

@boyvinall
Last active September 13, 2018 20:44
Show Gist options
  • Save boyvinall/f23420215707fa3e73e21c3f9a5ff22b to your computer and use it in GitHub Desktop.
Save boyvinall/f23420215707fa3e73e21c3f9a5ff22b to your computer and use it in GitHub Desktop.
#ifndef DEFS_H
#define DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* DEFS_H */
#include <stdio.h>
#include <stdlib.h>
#include "defs.h"
void display_hello()
{
printf("Hello!\n");
}
#ifndef HELLO_H
#define HELLO_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* HELLO_H */
void display_hello();
#include "defs.h"
#include "hello.h"
int main(int argc, char** argv) {
display_hello();
return (EXIT_SUCCESS);
}
objects = main.o hello.o
hello : $(objects)
cc -o hello $(objects)
hello.o : defs.h
main.o : defs.h hello.h
.PHONY : clean
clean :
-rm hello $(objects)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment