Last active
August 17, 2021 08:06
-
-
Save gue-ni/1e0c5b181f796a193f3faf80bb4683a5 to your computer and use it in GitHub Desktop.
Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $@ := 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