]> rtime.felk.cvut.cz Git - jailhouse-test.git/commitdiff
Make Makefile work as intended
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 8 Apr 2016 11:08:24 +0000 (13:08 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 8 Apr 2016 11:44:39 +0000 (13:44 +0200)
build/l4/.gitignore [new file with mode: 0644]
build/l4/Makefile

diff --git a/build/l4/.gitignore b/build/l4/.gitignore
new file mode 100644 (file)
index 0000000..2d41cce
--- /dev/null
@@ -0,0 +1,2 @@
+/fiasco/
+/l4re/
index df8037943cd6e937a6dd5d4b52615fe41b32d02a..e1989c57e3a466d56910f9d83237abc17a403281 100644 (file)
@@ -1,21 +1,38 @@
 all: fiasco l4re
 
+help:
+       @echo "Supported targets:"
+       @echo "  all           - Build all"
+       @echo "  fiasco        - Build Fiasco kernel"
+       @echo "  fiasco-config - Reconfigure Fiasco kernel"
+       @echo "  l4re          - Build L4 runtime environment"
+       @echo "  l4re-config   - Reconfigure L4 runtime environment"
+       @echo "  hello         - Build image with hello entry"
+
 .NOTPARALLEL:
 
+########## Fiasco ##########
+
+.PHONY: fiasco
 fiasco: fiasco/globalconfig.out
-       $(MAKE) -C $(CURDIR)/fiasco
+       $(MAKE) -C fiasco
 
+.PHONY: fiasco-config
 fiasco-config: fiasco/globalconfig.out
 
 ifeq ($(MAKECMDGOALS),fiasco-config)
 .PHONY: fiasco/globalconfig.out
 endif
 
-fiasco/globalconfig.out: $(CURDIR)/fiasco
-       $(MAKE) -C $(CURDIR)/fiasco config
+fiasco/globalconfig.out: fiasco/.stamp-jh
+       $(MAKE) -C $(@D) config
+       touch $@
 
-$(CURDIR)/fiasco:
-       $(MAKE) -C ../../l4/kernel/fiasco BUILDDIR=$@
+fiasco/.stamp-jh:
+       $(MAKE) -C ../../l4/kernel/fiasco BUILDDIR=$(CURDIR)/$(@D)
+       touch $@
+
+########## L4Re ##########
 
 L4RE_PKGS = acpica bootstrap cxx_thread drivers drivers-frst fb-drv    \
 hello input io/io io/libio io/libio-direct io/libio-io io/libvbus      \
@@ -32,21 +49,26 @@ l4re-core/uclibc-minimal libedid libirq libvcpu loader log lxfuxlibc        \
 rtc shmc x86emu
 
 .PHONY: l4re
-l4re: l4/.kconfig
-       $(MAKE) -C l4 #S="$(L4RE_PKGS:%=pkg/%)"
+l4re: l4re/.kconfig
+       $(MAKE) -C l4re #S="$(L4RE_PKGS:%=pkg/%)"
 
-l4re-config: l4/.kconfig
+.PHONY: l4re-config
+l4re-config: l4re/.kconfig
 
-ifeq ($(MAKECMDGOALS),l4-config)
-.PHONY: l4/.kconfig
+ifeq ($(MAKECMDGOALS),l4re-config)
+.PHONY: l4re/.kconfig
 endif
 
-l4/.kconfig: $(CURDIR)/l4
-       $(MAKE) -C l4 config
+l4re/.kconfig: l4re/.stamp-jh
+       $(MAKE) -C $(@D) config
+       touch $@
+
+l4re/.stamp-jh:
+       $(MAKE) -C ../../l4/l4 B=$(CURDIR)/$(@D)
+       touch $@
 
-$(CURDIR)/l4:
-       $(MAKE) -C ../../l4/l4 B=$@
+########## Application ##########
 
 .PHONY: hello
 hello:
-       $(MAKE) -C l4 MODULE_SEARCH_PATH=$(CURDIR)/fiasco E=hello elfimage
+       $(MAKE) -C l4re MODULE_SEARCH_PATH=$(CURDIR)/fiasco E=hello elfimage