Add target %/Makefile to Makefile and add Makefiles of subprojects as
prerequisites for compilation. This ammends the situation when after git
clone, the submodule folders are empty nad compilation fails because
header files are missing.
$(NAME) : $(OBJS) $(LFT) $(MLX)
$(CC) $(CFLAGS) $(OBJS) -o $@ $(LINKGRAPH)
-%.o : %.c
+%.o : %.c $(LFTDIR)Makefile $(MLX)Makefile
$(CC) $(CFLAGS) $(INCGRAPH) -c $< -o $@
-$(MLX) :
+$(MLX) : | $(MLXDIR)Makefile
$(MAKE) -C $(MLXDIR)
-$(LFT) :
+$(LFT) : | $(LFTDIR)Makefile
ifneq (,$(findstring debug, $(MAKECMDGOALS)))
$(MAKE) -C $(LFTDIR) debug
else
re : fclean
$(MAKE)
+
+%/Makefile :
+ git submodule update --init $($@%/Makefile=%)