Skip to content

Instantly share code, notes, and snippets.

@Isweet
Created January 12, 2022 19:36
Show Gist options
  • Save Isweet/674322d80d84d95d60e374340d043b09 to your computer and use it in GitHub Desktop.
Save Isweet/674322d80d84d95d60e374340d043b09 to your computer and use it in GitHub Desktop.
Makefile wat
// dep.h
int dep();
// dep.c
#include "dep.h"
int dep() {
return 10;
}
// foo.c
#include "dep.h"
int main() {
return dep();
}
// Makefile
%.o: %.c
$(CXX) -o $@ $< $(CFLAGS) -c
%.x: %.o
$(CXX) -o $@ $(CFLAGS) $^
foo.x: dep.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment