Skip to content

Instantly share code, notes, and snippets.

@gue-ni
Last active August 17, 2021 08:06
Show Gist options
  • Save gue-ni/1e0c5b181f796a193f3faf80bb4683a5 to your computer and use it in GitHub Desktop.
Save gue-ni/1e0c5b181f796a193f3faf80bb4683a5 to your computer and use it in GitHub Desktop.
Makefile
# $@ := output
# $< := first dependency
CC = gcc
CFLAGS = -std=c99 -pedantic -Wall -g
PROGS = test_program
all: $(PROGS)
rm -f *.o
$(PROGS): % : %.o
$(CC) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^
clean:
rm -f *.o $(PROGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment