Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. manifests = make.manifest make-huge.manifest make-local.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. all debug: $(manifests) configure $(graphene_target) $(graphene_libs)
  6. test_tarballs = oggenc-1.4 bzip2-1.0.6
  7. test_targets = $(test_tarballs) helloworld graphene
  8. make_src = make-3.82
  9. make-local: $(make_src)/make
  10. cp $< make-local
  11. $(make_src) $(test_tarballs): %: %.tar.gz
  12. [ -d $@ ] || tar -zxf $<
  13. $(make_src)/make:
  14. cd $(make_src) && ./configure
  15. cd $(make_src) && $(MAKE) CC="gcc -g"
  16. $(graphene_target): graphene/%: ../../../../../%
  17. cd $< && git checkout-index -a -f --prefix=$(PWD)/graphene/
  18. $(graphene_libs): graphene/%: ../../../../../%
  19. mkdir -p $(dir $@)
  20. ln -sf $(shell readlink -f $<) $@
  21. test: all $(test_targets)
  22. $(manifests): %: %.template
  23. $(MAKE) -C .. make/$@ appdir=make/
  24. configure: $(test_targets)
  25. for d in $(test_targets); do \
  26. if [ ! -f $$d/Makefile ] && [ -f $$d/configure ]; then \
  27. cd $$d; ./configure; cd ..; \
  28. fi; \
  29. done
  30. clean: clean-manifests clean-tests
  31. distclean: clean-manifests clean-tests
  32. rm -rf $(make_src) $(MAKE) result $(test_tarballs) $(graphene_target) $(graphene_libs)
  33. clean-manifests:
  34. rm -rf $(manifests)
  35. clean-tests:
  36. for d in $(test_targets); do ([ ! -d $$d ] || $(MAKE) -C $$d clean); done