Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. include Makefile.am
  2. CFLAGS += -I. -Iinclude -I../.. -I../../../include -I../../../lib -I../../../ipc/linux \
  3. -I../../../linux-kernel/graphene
  4. ASFLAGS += -I. -Iinclude -I../.. -I../../../include
  5. host_target = libpal-FreeBSD.a ../../pal-gdb
  6. defs = -DIN_PAL -DPAL_DIR="$(PAL_DIR)"
  7. objs = $(addprefix db_,files devices pipes sockets streams memory threading \
  8. mutex events process object main rtld misc ipc \
  9. exception2) rfork_thread
  10. graphene_lib = .lib/graphene-lib.a
  11. headers = $(wildcard *.h) $(wildcard ../../*.h) $(wildcard ../../../lib/*.h)
  12. .PHONY: all
  13. all: $(host_target)
  14. ifeq ($(DEBUG),1)
  15. CC += -g -gdwarf-2 -gstrict-dwarf
  16. CFLAGS += -DDEBUG
  17. export DEBUG
  18. endif
  19. pal-gdb: pal-gdb.template
  20. sed -e 's:\$$(PAL_DIR):$(PWD):g' $< > $@
  21. chmod 755 $@
  22. libpal-FreeBSD.a: $(addsuffix .o,$(objs)) $(graphene_lib)
  23. @echo [ host/FreeBSD/$@ ]
  24. @$(AR) $(ARFLAGS) $@ $^
  25. %.asm: %.c $(headers)
  26. $(CC) $(CFLAGS) $(defs) -c $< -o $<.o
  27. @objdump -S $<.o > $@
  28. @rm $<.o
  29. %.o: %.c $(headers)
  30. @echo [ host/FreeBSD/$@ ]
  31. @$(CC) $(CFLAGS) $(defs) -c $< -o $@
  32. %.e: %.c $(headers)
  33. @echo [ host/FreeBSD/$@ ]
  34. @$(CC) $(CFLAGS) $(defs) -E $< -o $@
  35. %.o: %.S $(headers)
  36. @echo [ host/FreeBSD/$@ ]
  37. @$(AS) $(ASFLAGS) $(defs) -c $< -o $@
  38. %.e: %.S $(headers)
  39. @echo [ host/FreeBSD/$@ ]
  40. @$(AS) $(ASFLAGS) $(defs) -E $< -o $@
  41. .PHONY: clean
  42. clean:
  43. rm -f $(addsuffix .o,$(objs)) $(host_target)