CFILES := $(wildcard *.c) CFILES += $(wildcard test/*.c) OFILES := $(patsubst %.c,%.o,$(CFILES)) OUT := malloc-test CFLAGS := -Wall -Wextra -Wpedantic all: $(OUT) ./$(OUT) clean: rm $(OFILES) $(OUT): ${OFILES} $(JDTLIB) $(CC) $(OFILES) -o $(OUT) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@