From: Lukas Jiriste Date: Tue, 16 Jan 2024 09:38:15 +0000 (+0100) Subject: Change Makefile to download submodules X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=b620178705abae6f5a5e6c22d49736f764407f33;p=42%2Ffract-ol.git Change Makefile to download submodules 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. --- diff --git a/Makefile b/Makefile index 510eea5..4f55ad5 100644 --- a/Makefile +++ b/Makefile @@ -21,13 +21,13 @@ debug : $(NAME) $(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 @@ -46,3 +46,6 @@ fclean : re : fclean $(MAKE) + +%/Makefile : + git submodule update --init $($@%/Makefile=%)