Makefile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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:\$$(PAL):../pal_loader:g' \
  11. -e 's:\$$(DEBUGTYPE):$(if $(DEBUG),inline,none):g' \
  12. -e 's:\$$(GCCDIR):$(patsubst %/cc1,%,$(shell gcc -print-file-name=cc1)):g' \
  13. -e 's:\$$(HUGERULE):$(if $(HUGE),$(huge_rule),):g'
  14. level = ../../
  15. include ../../Makefile
  16. test_tarballs = oggenc-1.4 bzip2-1.0.6
  17. test_targets = $(test_tarballs) helloworld graphene
  18. make_src = make-3.82
  19. $(make_src) $(test_tarballs): %: %.tar.gz
  20. [ -d $@ ] || tar -zxf $<
  21. $(make_src)/make:
  22. cd $(make_src) && ./configure
  23. cd $(make_src) && $(MAKE) CC="gcc -g"
  24. $(graphene_target): graphene/%: ../../../../../%
  25. cd $< && git checkout-index -a -f --prefix=$(PWD)/graphene/
  26. $(graphene_libs): graphene/%: ../../../../../%
  27. mkdir -p $(dir $@)
  28. ln -sf $(shell readlink -f $<) $@
  29. configure: $(test_targets)
  30. for d in $(test_targets); do \
  31. if [ ! -f $$d/Makefile ] && [ -f $$d/configure ]; then \
  32. cd $$d; ./configure; cd ..; \
  33. fi; \
  34. done
  35. distclean: clean-manifests clean-tests
  36. rm -rf $(make_src) $(MAKE) result $(test_tarballs) $(graphene_target) $(graphene_libs)
  37. clean-tests:
  38. for d in $(test_targets); do ([ ! -d $$d ] || $(MAKE) -C $$d clean); done