Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. manifests = make.manifest
  2. graphene_dirs = LibOS/shim/src LibOS/shim/include Pal/lib Pal/include Pal/src
  3. graphene_target = $(addprefix graphene/,$(graphene_dirs))
  4. graphene_libs = $(addprefix graphene/Pal/src/,libpal.so libpal.a)
  5. target = configure $(graphene_target) $(graphene_libs)
  6. exec_target = $(manifests)
  7. clean-extra = clean-tests
  8. huge_rule = sys.stack.size = 64M\nsys.brk.size = 256M\nglibc.heap_size = 16M\nsgx.enclave_size = 2G
  9. extra_rules = \
  10. -e 's:\$$(DEBUGTYPE):$(if $(DEBUG),inline,none):g' \
  11. -e 's:\$$(GCCDIR):$(patsubst %/cc1,%,$(shell gcc -print-file-name=cc1)):g' \
  12. -e 's:\$$(HUGERULE):$(if $(HUGE),$(huge_rule),):g'
  13. level = ../../
  14. include ../../Makefile
  15. test_tarballs = oggenc-1.4 bzip2-1.0.6
  16. test_targets = $(test_tarballs) helloworld graphene
  17. make_src = make-3.82
  18. $(make_src) $(test_tarballs): %: %.tar.gz
  19. [ -d $@ ] || tar -zxf $<
  20. $(make_src)/make:
  21. cd $(make_src) && ./configure
  22. cd $(make_src) && $(MAKE) CC="gcc -g"
  23. $(graphene_target): graphene/%: ../../../../../%
  24. cd $< && git checkout-index -a -f --prefix=$(PWD)/graphene/
  25. $(graphene_libs): graphene/%: ../../../../../%
  26. mkdir -p $(dir $@)
  27. ln -sf $(shell readlink -f $<) $@
  28. configure: $(test_targets)
  29. for d in $(test_targets); do \
  30. if [ ! -f $$d/Makefile ] && [ -f $$d/configure ]; then \
  31. cd $$d; ./configure; cd ..; \
  32. fi; \
  33. done
  34. distclean: clean-manifests clean-tests
  35. rm -rf $(make_src) $(MAKE) result $(test_tarballs) $(graphene_target) $(graphene_libs)
  36. clean-tests:
  37. for d in $(test_targets); do ([ ! -d $$d ] || $(MAKE) -C $$d clean); done