H = Queue.h LL.h Node.h C = main.cc LL.cc # these links to LL/ files will be automatically created, and removed in clean # LINKS = LL.cc LL.h Node.h CXX = g++ -std=c++17 -pedantic -Wall -g O=$(C:.cc=.o) main: $(O) $(CXX) $(O) -o main %.o: %.cc $(H) $(LINKS) $(CXX) -c $< clean: rm -f a.out core $(O) main $(LINKS) $(LINKS): for f in $(LINKS); do echo $$f; ln -s ../LL/$$f .; done