[tcp] Store local port in host byte order
[gpxe.git] / src / Makefile
blobbbd169b885d9dbead1b5dee922a4dab00bfe7375
1 ###############################################################################
3 # Initialise various variables
6 CLEANUP :=
7 CFLAGS :=
8 ASFLAGS :=
9 LDFLAGS :=
10 MAKEDEPS := Makefile
12 ###############################################################################
14 # Locations of tools
16 HOST_CC := gcc
17 RM := rm -f
18 TOUCH := touch
19 MKDIR := mkdir
20 CP := cp
21 ECHO := echo
22 PRINTF := printf
23 PERL := perl
24 CC := $(CROSS_COMPILE)gcc
25 CPP := $(CC) -E
26 AS := $(CROSS_COMPILE)as
27 LD := $(CROSS_COMPILE)ld
28 SIZE := $(CROSS_COMPILE)size
29 AR := $(CROSS_COMPILE)ar
30 RANLIB := $(CROSS_COMPILE)ranlib
31 OBJCOPY := $(CROSS_COMPILE)objcopy
32 NM := $(CROSS_COMPILE)nm
33 OBJDUMP := $(CROSS_COMPILE)objdump
34 PARSEROM := ./util/parserom.pl
35 FIXROM := ./util/fixrom.pl
36 SYMCHECK := ./util/symcheck.pl
37 SORTOBJDUMP := ./util/sortobjdump.pl
38 PADIMG := ./util/padimg.pl
39 LICENCE := ./util/licence.pl
40 NRV2B := ./util/nrv2b
41 ZBIN := ./util/zbin
42 ELF2EFI32 := ./util/elf2efi32
43 ELF2EFI64 := ./util/elf2efi64
44 EFIROM := ./util/efirom
45 ICCFIX := ./util/iccfix
46 EINFO := ./util/einfo
47 DOXYGEN := doxygen
48 BINUTILS_DIR := /usr
49 BFD_DIR := $(BINUTILS_DIR)
50 ZLIB_DIR := /usr
52 ###############################################################################
54 # SRCDIRS lists all directories containing source files.
56 SRCDIRS :=
57 SRCDIRS += libgcc
58 SRCDIRS += core
59 SRCDIRS += net net/tcp net/udp net/infiniband net/80211
60 SRCDIRS += image
61 SRCDIRS += drivers/bus
62 SRCDIRS += drivers/net
63 SRCDIRS += drivers/net/e1000
64 SRCDIRS += drivers/net/e1000e
65 SRCDIRS += drivers/net/igb
66 SRCDIRS += drivers/net/phantom
67 SRCDIRS += drivers/net/rtl818x
68 SRCDIRS += drivers/net/ath5k
69 SRCDIRS += drivers/net/vxge
70 SRCDIRS += drivers/net/efi
71 SRCDIRS += drivers/block
72 SRCDIRS += drivers/nvs
73 SRCDIRS += drivers/bitbash
74 SRCDIRS += drivers/infiniband
75 SRCDIRS += interface/pxe interface/efi interface/smbios
76 SRCDIRS += tests
77 SRCDIRS += crypto crypto/axtls crypto/matrixssl
78 SRCDIRS += hci hci/commands hci/tui
79 SRCDIRS += hci/mucurses hci/mucurses/widgets
80 SRCDIRS += usr
81 SRCDIRS += config
83 # NON_AUTO_SRCS lists files that are excluded from the normal
84 # automatic build system.
86 NON_AUTO_SRCS :=
87 NON_AUTO_SRCS += drivers/net/prism2.c
89 # INCDIRS lists the include path
91 INCDIRS :=
92 INCDIRS += include .
94 ###############################################################################
96 # Default build target: build the most common targets and print out a
97 # helpfully suggestive message
99 all : bin/blib.a bin/gpxe.dsk bin/gpxe.iso bin/gpxe.usb bin/undionly.kpxe \
100 bin/rtl8139.rom
101 @$(ECHO) '==========================================================='
102 @$(ECHO)
103 @$(ECHO) 'To create a bootable floppy, type'
104 @$(ECHO) ' cat bin/gpxe.dsk > /dev/fd0'
105 @$(ECHO) 'where /dev/fd0 is your floppy drive. This will erase any'
106 @$(ECHO) 'data already on the disk.'
107 @$(ECHO)
108 @$(ECHO) 'To create a bootable USB key, type'
109 @$(ECHO) ' cat bin/gpxe.usb > /dev/sdX'
110 @$(ECHO) 'where /dev/sdX is your USB key, and is *not* a real hard'
111 @$(ECHO) 'disk on your system. This will erase any data already on'
112 @$(ECHO) 'the USB key.'
113 @$(ECHO)
114 @$(ECHO) 'To create a bootable CD-ROM, burn the ISO image '
115 @$(ECHO) 'bin/gpxe.iso to a blank CD-ROM.'
116 @$(ECHO)
117 @$(ECHO) 'These images contain drivers for all supported cards. You'
118 @$(ECHO) 'can build more customised images, and ROM images, using'
119 @$(ECHO) ' make bin/<rom-name>.<output-format>'
120 @$(ECHO)
121 @$(ECHO) '==========================================================='
123 ###############################################################################
125 # Build targets that do nothing but might be tried by users
127 configure :
128 @$(ECHO) "No configuration needed."
130 install :
131 @$(ECHO) "No installation required."
133 ###############################################################################
135 # Version number calculations
137 VERSION_MAJOR = 1
138 VERSION_MINOR = 0
139 VERSION_PATCH = 1
140 EXTRAVERSION = +
141 MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
142 VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
143 CFLAGS += -DVERSION_MAJOR=$(VERSION_MAJOR) \
144 -DVERSION_MINOR=$(VERSION_MINOR) \
145 -DVERSION_PATCH=$(VERSION_PATCH) \
146 -DVERSION=\"$(VERSION)\"
147 IDENT = '$(@F) $(VERSION) (GPL) etherboot.org'
148 version :
149 @$(ECHO) $(VERSION)
151 ###############################################################################
153 # Drag in the bulk of the build system
156 MAKEDEPS += Makefile.housekeeping
157 include Makefile.housekeeping