Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Makefile 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. # Initialise variables that get added to throughout the various Makefiles
  2. #
  3. MAKEDEPS := Makefile .toolcheck
  4. SRCDIRS :=
  5. SRCS :=
  6. NON_AUTO_SRCS :=
  7. DRIVERS :=
  8. ROMS :=
  9. MEDIA :=
  10. NON_AUTO_MEDIA :=
  11. # Grab the central Config file.
  12. #
  13. MAKEDEPS += Config
  14. include Config
  15. # If no architecture is specified in Config or on the command-line,
  16. # use that of the build machine.
  17. #
  18. ifndef ARCH
  19. ARCH := $(shell uname -m | sed -e s,i[3456789]86,i386,)
  20. endif
  21. # Drag in architecture-specific Config
  22. #
  23. MAKEDEPS += arch/$(ARCH)/Config
  24. include arch/$(ARCH)/Config
  25. # If invoked with no build target, print out a helpfully suggestive
  26. # message.
  27. #
  28. noargs :
  29. @echo '===================================================='
  30. @echo 'No target specified. To specify a target, do: '
  31. @echo
  32. @echo ' $(MAKE) bin/<rom-name>.<output-format> '
  33. @echo
  34. @echo 'where <output-format> is one of [z]{$(MEDIA) }'
  35. @echo
  36. @echo 'or: '
  37. @echo
  38. @echo ' $(MAKE) all<output-format>s'
  39. @echo
  40. @echo 'to generate all possible images of format <output-format>'
  41. @echo
  42. @echo 'For example, '
  43. @echo
  44. @echo ' make allzroms '
  45. @echo
  46. @echo 'will generate all possible .zrom (rom burnable) images, and'
  47. @echo
  48. @echo ' make allzdsks'
  49. @echo
  50. @echo 'will generate all possible .zdsk (bootable floppy) images, or'
  51. @echo
  52. @echo '===================================================='
  53. @exit 1
  54. # Locations of utilities
  55. #
  56. HOST_CC ?= gcc
  57. CPP ?= gcc -E -Wp,-Wall
  58. RM ?= rm -f
  59. TOUCH ?= touch
  60. MKDIR ?= mkdir
  61. PERL ?= /usr/bin/perl
  62. CC ?= $(CROSS_COMPILE)gcc
  63. AS ?= $(CROSS_COMPILE)as
  64. LD ?= $(CROSS_COMPILE)ld
  65. SIZE ?= $(CROSS_COMPILE)size
  66. AR ?= $(CROSS_COMPILE)ar
  67. RANLIB ?= $(CROSS_COMPILE)ranlib
  68. OBJCOPY ?= $(CROSS_COMPILE)objcopy
  69. NM ?= $(CROSS_COMPILE)nm
  70. OBJDUMP ?= $(CROSS_COMPILE)objdump
  71. PARSEROM ?= $(PERL) ./util/parserom.pl
  72. MAKEROM ?= $(PERL) ./util/makerom.pl
  73. MKCONFIG ?= $(PERL) ./util/mkconfig.pl
  74. SYMCHECK ?= $(PERL) ./util/symcheck.pl
  75. SORTOBJDUMP ?= $(PERL) ./util/sortobjdump.pl
  76. NRV2B ?= ./util/nrv2b
  77. DOXYGEN ?= doxygen
  78. # Location to place generated files
  79. #
  80. BIN ?= bin
  81. # Common flags
  82. #
  83. CFLAGS += -I include -I arch/$(ARCH)/include -I . -DARCH=$(ARCH)
  84. CFLAGS += -Os -ffreestanding
  85. CFLAGS += -Wall -W
  86. CFLAGS += -g
  87. CFLAGS += $(EXTRA_CFLAGS)
  88. ASFLAGS += $(EXTRA_ASFLAGS)
  89. LDFLAGS += $(EXTRA_LDFLAGS)
  90. # CFLAGS for specific object types
  91. #
  92. CFLAGS_c +=
  93. CFLAGS_S += -DASSEMBLY
  94. # Base object name of the current target
  95. #
  96. OBJECT = $(firstword $(subst ., ,$(@F)))
  97. # CFLAGS for specific object files. You can define
  98. # e.g. CFLAGS_rtl8139, and have those flags automatically used when
  99. # compiling bin/rtl8139.o.
  100. #
  101. OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
  102. $(BIN)/%.flags :
  103. @echo $(OBJ_CFLAGS)
  104. # Rules for specific object types.
  105. #
  106. COMPILE_c = $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
  107. RULE_c = $(COMPILE_c) -c $< -o $@
  108. RULE_c_to_dbg%.o = $(COMPILE_c) -Ddebug_$(OBJECT)=$* -c $< -o $@
  109. RULE_c_to_c = $(COMPILE_c) -E -c $< > $@
  110. RULE_c_to_s = $(COMPILE_c) -S -g0 -c $< -o $@
  111. PREPROCESS_S = $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
  112. ASSEMBLE_S = $(AS) $(ASFLAGS)
  113. RULE_S = $(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
  114. RULE_S_to_s = $(PREPROCESS_S) $< > $@
  115. DEBUG_TARGETS += dbg%.o c s
  116. # SRCDIRS lists all directories containing source files.
  117. #
  118. SRCDIRS += core
  119. SRCDIRS += proto
  120. SRCDIRS += net net/tcp net/udp
  121. SRCDIRS += image
  122. SRCDIRS += drivers/bus
  123. SRCDIRS += drivers/net
  124. SRCDIRS += drivers/block
  125. SRCDIRS += drivers/scsi
  126. SRCDIRS += drivers/ata
  127. SRCDIRS += drivers/nvs
  128. SRCDIRS += drivers/bitbash
  129. SRCDIRS += interface/pxe
  130. SRCDIRS += tests
  131. SRCDIRS += crypto
  132. SRCDIRS += hci hci/commands hci/tui
  133. SRCDIRS += hci/mucurses hci/mucurses/widgets
  134. SRCDIRS += usr
  135. # NON_AUTO_SRCS lists files that are excluded from the normal
  136. # automatic build system.
  137. #
  138. NON_AUTO_SRCS += core/elf_loader.c
  139. NON_AUTO_SRCS += drivers/net/prism2.c
  140. # Rules for finalising files. TGT_MAKEROM_FLAGS is defined as part of
  141. # the automatic build system and varies by target; it includes the
  142. # "-p 0x1234,0x5678" string to set the PCI IDs.
  143. #
  144. FINALISE_rom = $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
  145. -i$(IDENT) $@
  146. # Some ROMs require specific flags to be passed to makerom.pl
  147. #
  148. MAKEROM_FLAGS_3c503 = -3
  149. # Drag in architecture-specific Makefile
  150. #
  151. MAKEDEPS += arch/$(ARCH)/Makefile
  152. include arch/$(ARCH)/Makefile
  153. # Drag in the automatic build system and other housekeeping functions
  154. MAKEDEPS += Makefile.housekeeping
  155. include Makefile.housekeeping