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