Makefile-i386 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. core-y += arch/um/sys-i386/ arch/i386/crypto/
  2. TOP_ADDR := $(CONFIG_TOP_ADDR)
  3. ifeq ($(CONFIG_MODE_SKAS),y)
  4. ifneq ($(CONFIG_MODE_TT),y)
  5. START := 0x8048000
  6. endif
  7. endif
  8. LDFLAGS += -m elf_i386
  9. ELF_ARCH := $(SUBARCH)
  10. ELF_FORMAT := elf32-$(SUBARCH)
  11. OBJCOPYFLAGS := -O binary -R .note -R .comment -S
  12. ifeq ("$(origin SUBARCH)", "command line")
  13. ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
  14. CFLAGS += $(call cc-option,-m32)
  15. USER_CFLAGS += $(call cc-option,-m32)
  16. HOSTCFLAGS += $(call cc-option,-m32)
  17. HOSTLDFLAGS += $(call cc-option,-m32)
  18. AFLAGS += $(call cc-option,-m32)
  19. LINK-y += $(call cc-option,-m32)
  20. UML_OBJCOPYFLAGS += -F $(ELF_FORMAT)
  21. export LDFLAGS HOSTCFLAGS HOSTLDFLAGS UML_OBJCOPYFLAGS
  22. endif
  23. endif
  24. CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH)
  25. ifneq ($(CONFIG_GPROF),y)
  26. ARCH_CFLAGS += -DUM_FASTCALL
  27. endif
  28. SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util
  29. SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h
  30. prepare: $(SYS_HEADERS)
  31. $(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc
  32. $(call filechk,gen_header)
  33. $(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread
  34. $(call filechk,gen_header)
  35. $(SYS_UTIL_DIR)/mk_sc: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE
  36. $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@
  37. $(SYS_UTIL_DIR)/mk_thread: scripts_basic $(ARCH_DIR)/kernel-offsets.h FORCE
  38. $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@
  39. $(SYS_UTIL_DIR): scripts_basic include/asm FORCE
  40. $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR)
  41. CLEAN_FILES += $(SYS_HEADERS)