22 lines
504 B
Makefile
22 lines
504 B
Makefile
|
CC = gcc
|
||
|
CFLAGS = -g -Wall -Werror -Wextra -Wformat=2 -Wjump-misses-init -Wlogical-op -Wpedantic -Wshadow
|
||
|
#CFLAGS = -ansi -g -Wall -Werror -Wextra -Wformat=2 -Wjump-misses-init -Wlogical-op -Wpedantic -Wshadow
|
||
|
#CFLAGS = -Wall -Werror -Wextra -Wpedantic
|
||
|
EXECUTABLE = ls
|
||
|
|
||
|
SOURCES = ls.c
|
||
|
OBJECTS = $(SOURCES:.c=.o)
|
||
|
|
||
|
all: $(EXECUTABLE)
|
||
|
|
||
|
$(EXECUTABLE): $(OBJECTS)
|
||
|
$(CC) $(OBJECTS) -o $(EXECUTABLE) $(LDFLAGS)
|
||
|
|
||
|
%.o: %.c
|
||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||
|
|
||
|
clean:
|
||
|
rm -f $(OBJECTS) $(EXECUTABLE)
|
||
|
|
||
|
.PHONY: all clean
|