diff --git a/sk1/Makefile b/sk1/Makefile index feaffbe..4bd6985 100644 --- a/sk1/Makefile +++ b/sk1/Makefile @@ -1,33 +1,16 @@ -# Compiler and flags CC = gcc -CFLAGS = -Wall -Wextra -std=c11 +CFLAGS = -Wall -Wextra -std=c99 -# Targets -TARGET = compressor +all: compressor -# Source files -SRCS = main.c compressor.c +compressor: main.o compressor.o + $(CC) $(CFLAGS) -o compressor main.o compressor.o -# Object files -OBJS = $(SRCS:.c=.o) +main.o: main.c compressor.h + $(CC) $(CFLAGS) -c main.c -# Header files -DEPS = compressor.h +compressor.o: compressor.c compressor.h + $(CC) $(CFLAGS) -c compressor.c -# Default rule -all: $(TARGET) - -# Linking the executable -$(TARGET): $(OBJS) - $(CC) $(CFLAGS) -o $@ $^ - -# Compiling source files into object files -%.o: %.c $(DEPS) - $(CC) $(CFLAGS) -c $< -o $@ - -# Clean rule clean: - rm -f $(OBJS) $(TARGET) - -# Phony targets -.PHONY: all clean + rm -f *.o compressor \ No newline at end of file