diff --git a/.gitignore b/.gitignore index b14960b..51b09c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .vscode *.bmp -tricorn \ No newline at end of file +tricorn +*.o +*.d \ No newline at end of file diff --git a/Implementierung/Makefile b/Implementierung/Makefile index f8d0de5..321ec74 100644 --- a/Implementierung/Makefile +++ b/Implementierung/Makefile @@ -1,12 +1,24 @@ -CFLAGS= -Wall -Wextra -O3 -LDLIBS = -lm CC = gcc +CFLAGS = -Wall -Wextra -O3 -std=c17 +DEPFLAGS = -MMD -MP +LDFLAGS = -lm + +TARGET = tricorn +SRCS = $(wildcard *.c) +OBJS = $(SRCS:.c=.o) +DEPS = $(SRCS:.c=.d) .PHONY: all clean -all: tricorn +all: $(TARGET) + +$(TARGET): $(OBJS) + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +%.o: %.c + $(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@ + +-include $(DEPS) -tricorn: main.c tricorn.c - $(CC) $(CFLAGS) -o $@ $^ $(LDLIBS) clean: - rm -f tricorn \ No newline at end of file + rm -f $(OBJS) $(DEPS) $(TARGET) \ No newline at end of file