Makefile 1.3 KB

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