target = $(shell basename $(shell pwd)) objects := $(patsubst %,%.o,$(basename $(wildcard *.c))) includes := $(wildcard *.h) CC = gcc CFLAGS = -Wall -I$(shell pwd) -g $(target) : $(objects) $(includes) ; gcc -o $(target) $(objects) $(objects) : $(includes) .PHONY: clean clean: rm -f $(target) $(objects)