diff --git a/Makefile b/Makefile index 4a6bbd4a1..d70a413c0 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,15 @@ -# -# Import the build engine first __nmk_dir=$(CURDIR)/scripts/nmk/scripts/ export __nmk_dir +# +# No need to try to remake our Makefiles +Makefile: ; +Makefile.%: ; +scripts/%.mak: ; +$(__nmk_dir)%.mk: ; + +# +# Import the build engine include $(__nmk_dir)include.mk include $(__nmk_dir)macro.mk @@ -213,6 +220,7 @@ SOCCR_A := soccr/libsoccr.a SOCCR_CONFIG := soccr/config.h $(SOCCR_CONFIG): $(CONFIG_HEADER) $(Q) test -f $@ || ln -s ../$(CONFIG_HEADER) $@ +soccr/Makefile: ; soccr/%: $(SOCCR_CONFIG) .FORCE $(Q) $(MAKE) $(build)=soccr $@ soccr/built-in.o: $(SOCCR_CONFIG) .FORCE @@ -228,6 +236,9 @@ criu-deps += $(SOCCR_A) # # But note that we're already included # the nmk so we can reuse it there. +criu/Makefile: ; +criu/Makefile.packages: ; +criu/Makefile.crtools: ; criu/%: $(criu-deps) .FORCE $(Q) $(MAKE) $(build)=criu $@ criu: $(criu-deps) @@ -238,6 +249,7 @@ criu: $(criu-deps) # Libraries next once criu it ready # (we might generate headers and such # when building criu itself). +lib/Makefile: ; lib/%: criu .FORCE $(Q) $(MAKE) $(build)=lib $@ lib: criu diff --git a/Makefile.compel b/Makefile.compel index 7586ef3ac..408f0a701 100644 --- a/Makefile.compel +++ b/Makefile.compel @@ -31,6 +31,7 @@ criu-deps += compel/$(LIBCOMPEL_A) # # Compel itself. +compel/Makefile: ; compel/%: $(compel-deps) $(compel-plugins) .FORCE $(Q) $(MAKE) $(build)=compel $@ @@ -38,6 +39,7 @@ criu-deps += compel/compel-host-bin # # Plugins +compel/plugins/Makefile: ; compel/plugins/%: $(compel-deps) .FORCE $(Q) $(MAKE) $(build)=compel/plugins $@ diff --git a/criu/Makefile b/criu/Makefile index ada75af3a..735890e0f 100644 --- a/criu/Makefile +++ b/criu/Makefile @@ -57,6 +57,8 @@ pie: criu/pie/pie.lib.a $(Q) $(MAKE) $(build)=criu/pie all .PHONY: pie +criu/pie/Makefile: ; +criu/pie/Makefile.library: ; criu/pie/%: pie ; # @@ -71,8 +73,10 @@ PROGRAM-BUILTINS += $(COMPEL_LIBS) $(obj)/built-in.o: pie $(Q) $(MAKE) $(call build-as,Makefile.crtools,criu) all -$(obj)/Makefile: - @true + +$(obj)/Makefile: ; +$(obj)/Makefile.crtools: ; +$(obj)/Makefile.packages: ; $(obj)/%: pie $(Q) $(MAKE) $(call build-as,Makefile.crtools,criu) $@ diff --git a/lib/Makefile b/lib/Makefile index 4bc865a45..a8647ce7a 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -12,8 +12,8 @@ all-y += lib-c lib-py # # C language bindings. +lib/c/Makefile: ; lib/c/%: .FORCE - $(call msg-gen, $@) $(Q) $(MAKE) $(build)=lib/c $@ cflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(CRIU_SO).$(CRIU_SO_VERSION_MAJOR) @@ -27,6 +27,7 @@ lib-c: lib/c/$(CRIU_SO) # # Python bindings. +lib/py/Makefile: ; lib/py/%: .FORCE $(call msg-gen, $@) $(Q) $(MAKE) $(build)=lib/py $@ diff --git a/lib/py/Makefile b/lib/py/Makefile index 413b3da55..5eb77d40e 100644 --- a/lib/py/Makefile +++ b/lib/py/Makefile @@ -2,6 +2,7 @@ all-y += libpy-images rpc_pb2.py .PHONY: .FORCE +$(obj)/images/Makefile: ; $(obj)/images/%: .FORCE $(Q) $(MAKE) $(build)=$(obj)/images $@