All pastes #2103920 Raw Edit

Anonymous

public text v1 · immutable
#2103920 ·published 2012-01-18 21:34 UTC
rendered paste body
/* foo.h */
#ifndef FOO_H
#define FOO_H

// here we document how awesome foo() is.
void foo();

#endif // FOO_H

/* foo.c */
#include "foo.h"

void foo() { ... }

/* main.c */
#include "foo.h"

int main() {
    foo();
    return 0;
}

/* Makefile */
myprogram: main.o foo.o
    gcc -o myprogram main.o foo.o

main.o: main.c foo.h
    gcc -c main.c

foo.o: foo.c foo.h
    gcc -c foo.c