Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. include ../../../../Makefile.configs
  2. include Makefile.am
  3. CFLAGS += -I. -Iinclude -I../.. -I../../../include -I../../../lib \
  4. -I../../../linux-kernel/graphene
  5. ASFLAGS += -I. -Iinclude -I../.. -I../../../include
  6. ifeq ($(PROFILING),1)
  7. CFLAGS += -DPROFILING=1
  8. endif
  9. host_files = libpal-Linux.a pal.map
  10. defs = -DIN_PAL -DPAL_DIR=$(PAL_DIR) -DRUNTIME_DIR=$(RUNTIME_DIR)
  11. CFLAGS += $(defs)
  12. ASFLAGS += $(defs)
  13. objs = $(addprefix db_,files devices pipes eventfd sockets streams memory threading \
  14. mutex events process object main rtld misc \
  15. exception) clone-x86_64
  16. graphene_lib = .lib/graphene-lib.a
  17. .PHONY: all
  18. all: $(host_files)
  19. ifeq ($(DEBUG),1)
  20. CC += -gdwarf-2 -g3
  21. CFLAGS += -DDEBUG
  22. export DEBUG
  23. endif
  24. libpal-Linux.a: $(addsuffix .o,$(objs)) $(graphene_lib)
  25. $(call cmd,ar_a_o)
  26. %.o: %.c
  27. $(call cmd,cc_o_c)
  28. %.i: %.c
  29. $(call cmd,cpp_i_c)
  30. %.s: %.c
  31. $(call cmd,cc_s_c)
  32. %.o: %.S
  33. $(call cmd,as_o_S)
  34. %.s: %.S
  35. $(call cmd,cpp_s_S)
  36. include ../../../../Makefile.rules
  37. ifeq ($(filter clean,$(MAKECMDGOALS)),)
  38. -include $(addsuffix .d,$(objs)) $(addsuffix .i.d,$(objs)) $(addsuffix .s.d,$(objs))
  39. endif
  40. CLEAN_FILES += $(notdir $(pal_static) $(pal_lib) $(pal_sec) $(pal_loader))
  41. .PHONY: clean
  42. clean:
  43. rm -f $(addsuffix .o,$(objs)) $(host_files) $(CLEAN_FILES) \
  44. $(addsuffix .d,$(objs)) $(addsuffix .i.d,$(objs)) \
  45. $(addsuffix .s.d,$(objs))
  46. .PHONY: test
  47. test: