diff --git a/sk1/Makefile b/sk1/Makefile index 273f773..694242c 100644 --- a/sk1/Makefile +++ b/sk1/Makefile @@ -1,16 +1,35 @@ + + CC = gcc CFLAGS = -Wall -Wextra -std=c99 -all: compressor +TARGET = compressor -compressor: main.o compressor.o - $(CC) $(CFLAGS) -o compressor main.o compressor.o +SRCS = main.c compressor.c +HEADERS = compressor.h -main.o: main.c compressor.h - $(CC) $(CFLAGS) -c main.c -compressor.o: compressor.c compressor.h - $(CC) $(CFLAGS) -c compressor.c +OBJS = $(SRCS:.c=.o) + + +all: $(TARGET) + + +$(TARGET): $(OBJS) + $(CC) $(CFLAGS) -o $(TARGET) $(OBJS) + + +%.o: %.c $(HEADERS) + $(CC) $(CFLAGS) -c $< -o $@ + clean: - rm -f *.o compressor + rm -f $(OBJS) $(TARGET) + +help: + @echo "Usage: make [target]" + @echo "Targets:" + @echo " all - Build the project" + @echo " clean - Remove all built files" + @echo " help - Show this help message" +