This commit is contained in:
2021-05-31 10:40:05 +02:00
parent 9d69f22fea
commit dd10c5e464
2 changed files with 54 additions and 14 deletions

24
makefile Normal file
View File

@ -0,0 +1,24 @@
TARGET = prog
LIBS = -lm
CC = gcc
CFLAGS = -O2 -g -Wall
.PHONY: clean all default
default: $(TARGET)
all: default
OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
HEADERS = $(wildcard *.h)
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
.PRECIOUS: $(TARGET) $(OBJECTS)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -Wall $(LIBS) -o $@
clean:
-rm -f *.o
-rm -f $(TARGET)