Skip to content

Instantly share code, notes, and snippets.

@rjzak
Created May 4, 2016 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjzak/01c3ab7073fb524288effa5e6b53e217 to your computer and use it in GitHub Desktop.
Save rjzak/01c3ab7073fb524288effa5e6b53e217 to your computer and use it in GitHub Desktop.
Makefile template
CFLAGS+=-std=c99 -DMYDEFINE -g -O0
LDFLAGS+=-lm
DEPS = Makefile
all: myproj
%.o: %.c %.h $(DEPS)
$(CC) -fPIC -c -o $@ $< $(CFLAGS)
myproj: file.o main.o
$(CC) $(CFLAGS) -o injector file.o main.o $(LDFLAGS)
%.bin: %.asm $(DEPS)
fasm $<
debug: CFLAGS+=-DDEBUG
debug: all
clean:
rm -f myproj *.o
.PHONY: all clean debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment