Adding debian version 3.70~pre8+dfsg-1.
[syslinux-debian/hramrach.git] / gpxe / src / Makefile
blob0591bb016501377010ea0d1a0de57918eeae0b60
1 # Location to place generated files
3 BIN := bin
5 # Initialise variables that get added to throughout the various Makefiles
7 MAKEDEPS := Makefile .toolcheck .echocheck
8 SRCDIRS :=
9 SRCS :=
10 NON_AUTO_SRCS :=
11 DRIVERS :=
12 ROMS :=
13 MEDIA :=
14 NON_AUTO_MEDIA :=
16 # Locations of utilities
18 HOST_CC := gcc
19 RM := rm -f
20 TOUCH := touch
21 MKDIR := mkdir
22 CP := cp
23 ECHO := echo
24 PRINTF := printf
25 PERL := /usr/bin/perl
26 CC := $(CROSS_COMPILE)gcc
27 CPP := $(CROSS_COMPILE)gcc -E -Wp,-Wall
28 AS := $(CROSS_COMPILE)as
29 LD := $(CROSS_COMPILE)ld
30 SIZE := $(CROSS_COMPILE)size
31 AR := $(CROSS_COMPILE)ar
32 RANLIB := $(CROSS_COMPILE)ranlib
33 OBJCOPY := $(CROSS_COMPILE)objcopy
34 NM := $(CROSS_COMPILE)nm
35 OBJDUMP := $(CROSS_COMPILE)objdump
36 PARSEROM := $(PERL) ./util/parserom.pl
37 MAKEROM := $(PERL) ./util/makerom.pl
38 MKCONFIG := $(PERL) ./util/mkconfig.pl
39 SYMCHECK := $(PERL) ./util/symcheck.pl
40 SORTOBJDUMP := $(PERL) ./util/sortobjdump.pl
41 NRV2B := ./util/nrv2b
42 ZBIN := ./util/zbin
43 DOXYGEN := doxygen
45 # If invoked with no build target, print out a helpfully suggestive
46 # message.
48 noargs : blib $(BIN)/NIC $(BIN)/gpxe.dsk $(BIN)/gpxe.iso $(BIN)/gpxe.usb
49 @$(ECHO) '==========================================================='
50 @$(ECHO)
51 @$(ECHO) 'To create a bootable floppy, type'
52 @$(ECHO) ' cat $(BIN)/gpxe.dsk > /dev/fd0'
53 @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
54 @$(ECHO) 'data already on the disk.'
55 @$(ECHO)
56 @$(ECHO) 'To create a bootable USB key, type'
57 @$(ECHO) ' cat $(BIN)/gpxe.usb > /dev/sdX'
58 @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
59 @$(ECHO) 'disk on your system. This will erase any data already on'
60 @$(ECHO) 'the USB key.'
61 @$(ECHO)
62 @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
63 @$(ECHO) '$(BIN)/gpxe.iso to a blank CD-ROM.'
64 @$(ECHO)
65 @$(ECHO) 'These images contain drivers for all supported cards. You'
66 @$(ECHO) 'can build more customised images, and ROM images, using'
67 @$(ECHO) ' make bin/<rom-name>.<output-format>'
68 @$(ECHO)
69 @$(ECHO) '==========================================================='
71 # Grab the central Config file.
73 MAKEDEPS += Config
74 include Config
76 # If no architecture is specified in Config or on the command-line,
77 # use that of the build machine.
79 ARCH ?= $(shell uname -m | sed -e s,i[3456789]86,i386,)
81 # handle x86_64 like i386, but set -m32 option for 32bit code only
82 ifeq ($(ARCH),x86_64)
83 ARCH := i386
84 CFLAGS += -m32
85 ASFLAGS += --32
86 LDFLAGS += -m elf_i386
87 endif
89 # Drag in architecture-specific Config
91 MAKEDEPS += arch/$(ARCH)/Config
92 include arch/$(ARCH)/Config
94 # Common flags
96 CFLAGS += -I include -I arch/$(ARCH)/include -I . -DARCH=$(ARCH)
97 CFLAGS += -Os -ffreestanding
98 CFLAGS += -Wall -W
99 CFLAGS += -g
100 CFLAGS += $(EXTRA_CFLAGS)
101 ASFLAGS += $(EXTRA_ASFLAGS)
102 LDFLAGS += $(EXTRA_LDFLAGS)
104 # Embedded image, if present
106 EMBEDDED_IMAGE ?= /dev/null
108 ifneq ($(NO_WERROR),1)
109 CFLAGS += -Werror
110 endif
112 # CFLAGS for specific object types
114 CFLAGS_c +=
115 CFLAGS_S += -DASSEMBLY
117 # Base object name of the current target
119 OBJECT = $(firstword $(subst ., ,$(@F)))
121 # CFLAGS for specific object files. You can define
122 # e.g. CFLAGS_rtl8139, and have those flags automatically used when
123 # compiling bin/rtl8139.o.
125 OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
126 $(BIN)/%.flags :
127 @$(ECHO) $(OBJ_CFLAGS)
129 # Rules for specific object types.
131 COMPILE_c = $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
132 RULE_c = $(Q)$(COMPILE_c) -c $< -o $@
133 RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -Ddebug_$(OBJECT)=$* -c $< -o $@
134 RULE_c_to_c = $(Q)$(COMPILE_c) -E -c $< > $@
135 RULE_c_to_s = $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
137 PREPROCESS_S = $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
138 ASSEMBLE_S = $(AS) $(ASFLAGS)
139 RULE_S = $(Q)$(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
140 RULE_S_to_s = $(Q)$(PREPROCESS_S) $< > $@
142 DEBUG_TARGETS += dbg%.o c s
144 # SRCDIRS lists all directories containing source files.
146 SRCDIRS += libgcc
147 SRCDIRS += core
148 SRCDIRS += proto
149 SRCDIRS += net net/tcp net/udp
150 SRCDIRS += image
151 SRCDIRS += drivers/bus
152 SRCDIRS += drivers/net
153 SRCDIRS += drivers/net/e1000
154 SRCDIRS += drivers/block
155 SRCDIRS += drivers/scsi
156 SRCDIRS += drivers/ata
157 SRCDIRS += drivers/nvs
158 SRCDIRS += drivers/bitbash
159 SRCDIRS += drivers/infiniband
160 SRCDIRS += interface/pxe
161 SRCDIRS += tests
162 SRCDIRS += crypto crypto/axtls crypto/matrixssl
163 SRCDIRS += hci hci/commands hci/tui
164 SRCDIRS += hci/mucurses hci/mucurses/widgets
165 SRCDIRS += usr
167 # NON_AUTO_SRCS lists files that are excluded from the normal
168 # automatic build system.
170 NON_AUTO_SRCS += core/elf_loader.c
171 NON_AUTO_SRCS += drivers/net/prism2.c
173 # Rules for finalising files. TGT_MAKEROM_FLAGS is defined as part of
174 # the automatic build system and varies by target; it includes the
175 # "-p 0x1234,0x5678" string to set the PCI IDs.
177 FINALISE_rom = $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
178 -i$(IDENT) -s 0 $@
180 # Some ROMs require specific flags to be passed to makerom.pl
182 MAKEROM_FLAGS_3c503 = -3
184 # Drag in architecture-specific Makefile
186 MAKEDEPS += arch/$(ARCH)/Makefile
187 include arch/$(ARCH)/Makefile
189 # Drag in the automatic build system and other housekeeping functions
190 MAKEDEPS += Makefile.housekeeping
191 include Makefile.housekeeping