CFLAGS=-std=c99 -Wall -Wextra -pedantic
CPPFLAGS=-MMD -MF $*.d

all: main

include mod1/Makefile

main: $(obj-y) # build main from all obj-y (added in subdirs)
%.o: %.d # If dependencies have changed, recompile too
%.d: ; # if a dependency file is missing (eg. on first run), don't panic
clean:
	# delete object files and their dependencies as well as the executable
	@$(RM) -v $(obj-y) $(obj-y:.o=.d) main
.PHONY: all clean
.PRECIOUS: $(obj-y) $(obj-y:.o=.d)
