Skip to content
Snippets Groups Projects

Resolve "add makefile with structure"

Merged tom.ryser requested to merge 3-add-makefile-with-structure into main
4 files
+ 48
44
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 9
5
CC:=gcc
CFLAGS:= -g -Wextra -pedantic -fsanitize=address
CFLAGS:=-g -Wall -Wextra -pedantic -fsanitize=address
LDFLGS:=-fsanitize=address
NAME:=stack
$(NAME): main.o $(NAME).o
$(CC) $(CFLAGS) -o $@ $^ -lSDL2
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
tests: $(NAME)_tests.o $(NAME).o
$(CC) $(CFLAGS) -o $@ $^
test: $(NAME)_test.o $(NAME).o
$(CC) $(CFLAGS) -o $@ $^
./test
$(NAME).o: $(NAME).h
.PHONY: clean
clean:
rm -f *.o $(NAME) tests
rm -f *.o $(NAME) tests
Loading