Update sk1/Makefile
This commit is contained in:
parent
52775f5581
commit
7ca149f2d0
35
sk1/Makefile
35
sk1/Makefile
@ -1,16 +1,35 @@
|
|||||||
|
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -Wall -Wextra -std=c99
|
CFLAGS = -Wall -Wextra -std=c99
|
||||||
|
|
||||||
all: compressor
|
TARGET = compressor
|
||||||
|
|
||||||
compressor: main.o compressor.o
|
SRCS = main.c compressor.c
|
||||||
$(CC) $(CFLAGS) -o compressor main.o compressor.o
|
HEADERS = compressor.h
|
||||||
|
|
||||||
main.o: main.c compressor.h
|
|
||||||
$(CC) $(CFLAGS) -c main.c
|
|
||||||
|
|
||||||
compressor.o: compressor.c compressor.h
|
OBJS = $(SRCS:.c=.o)
|
||||||
$(CC) $(CFLAGS) -c compressor.c
|
|
||||||
|
|
||||||
|
all: $(TARGET)
|
||||||
|
|
||||||
|
|
||||||
|
$(TARGET): $(OBJS)
|
||||||
|
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS)
|
||||||
|
|
||||||
|
|
||||||
|
%.o: %.c $(HEADERS)
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
|
||||||
clean:
|
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"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user