Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. SYS ?= $(shell gcc -dumpmachine)
  2. export SYS
  3. apps = lmbench gcc busybox lighttpd bash apache make python r openjdk
  4. packed_apps = lmbench
  5. target = pal pal_sec
  6. clean-extra = clean-all
  7. level = ../
  8. include ../Makefile
  9. ifeq ($(SYS),x86_64-linux-gnu)
  10. HOSTDIR =
  11. PAL = $(abspath $(PWD)/../pal_loader)
  12. else
  13. HOSTDIR = /tmp/host
  14. PAL = $(abspath $(PWD)/../pal)
  15. endif
  16. manifest_rules = \
  17. -e 's:\$$(PAL):$(PAL):g' \
  18. -e 's:\$$(PWD):$(PWD)/:g' \
  19. -e 's:\$$(BIN):$(subst .manifest,,$(notdir $@)):g' \
  20. -e 's:\$$(SHIMPATH):$(abspath ../../src/libsysdb.so):g' \
  21. -e 's:\$$(GLIBCDIR):$(abspath $(glibc_dir))/:g' \
  22. -e 's:\$$(HOSTDIR):$(HOSTDIR):g' \
  23. $(extra_rules)
  24. %.manifest: %.manifest.template
  25. rm -f $@ $@.backup
  26. sed $(manifest_rules) $< >$@
  27. chmod +x $@
  28. ifeq ($(SYS),x86_64-linux-gnu)
  29. build-all:
  30. for f in $(apps); do (cd $$f; $(MAKE) $(DEBUG) || true; cd ..); done
  31. .PHONY: pack
  32. pack:
  33. for f in $(packed_apps); do (cd $$f; $(MAKE) pack; cd ..); done
  34. else
  35. build-all:
  36. for f in $(packed_apps); do (cd $$f; $(MAKE) || true; cd ..); done
  37. endif
  38. clean-all:
  39. for f in $(apps); do (cd $$f; $(MAKE) clean; cd ..); done