Last active
December 9, 2021 04:06
-
-
Save airglow923/1d9726808569038c9bfd3522c863ac15 to your computer and use it in GitHub Desktop.
Simple Makefile
This file contains 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
CC = clang | |
CFLAGS = -std=c11 -O0 -g3 -Wall -Wextra | |
ASAN_FLAGS = -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-recover=address | |
CSRC = $(wildcard *.c) | |
COBJ = $(patsubst %.c, %.o, $(CSRC)) | |
.PHONY: all | |
all: main | |
.PHONY: main | |
main: $(COBJ) | |
$(CC) $(CFLAGS) $(ASAN_FLAGS) $< -o $@ | |
%.o: %.c | |
$(CC) $(CFLAGS) $(ASAN_FLAGS) -c $< -o $@ | |
.PHONY: clean | |
clean: | |
rm -rf *.o main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment