~serge-hallyn/ubuntu/oneiric/ipxe/link-kvm

« back to all changes in this revision

Viewing changes to src/Makefile.housekeeping

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2011-07-31 20:57:02 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110731205702-kffmzz6tnmgfw50f
Tags: 1.0.0+git-2.149b50-1
New snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
#
89
89
# Check for tools that can cause failed builds
90
90
#
91
 
.toolcheck :
92
 
        @if $(CC) -v 2>&1 | grep -is 'gcc version 2\.96' > /dev/null; then \
93
 
                $(ECHO) 'gcc 2.96 is unsuitable for compiling Etherboot'; \
94
 
                $(ECHO) 'Use gcc 2.95 or gcc 3.x instead'; \
95
 
                exit 1; \
96
 
        fi
97
 
        @if [ `perl -e 'use bytes; print chr(255)' | wc -c` = 2 ]; then \
98
 
                $(ECHO) 'Your Perl version has a Unicode handling bug'; \
99
 
                $(ECHO) 'Execute this command before compiling Etherboot:'; \
100
 
                $(ECHO) 'export LANG=$${LANG%.UTF-8}'; \
101
 
                exit 1; \
102
 
        fi
103
 
        @$(TOUCH) $@
104
 
MAKEDEPS        += .toolcheck
105
 
VERYCLEANUP     += .toolcheck
 
91
 
 
92
ifeq ($(CCTYPE),gcc)
 
93
GCC_2_96_BANNER := $(shell $(CC) -v 2>&1 | grep -is 'gcc version 2\.96')
 
94
ifneq ($(GCC_2_96_BANNER),)
 
95
$(warning gcc 2.96 is unsuitable for compiling iPXE)
 
96
$(warning Use gcc 2.95 or a newer version instead)
 
97
$(error Unsuitable build environment found)
 
98
endif
 
99
endif
 
100
 
 
101
PERL_UNICODE_CHECK := $(shell $(PERL) -e 'use bytes; print chr(255)' | wc -c)
 
102
ifeq ($(PERL_UNICODE_CHECK),2)
 
103
$(warning Your Perl version has a Unicode handling bug)
 
104
$(warning Execute this command before building iPXE:)
 
105
$(warning export LANG=$${LANG%.UTF-8})
 
106
$(error Unsuitable build environment found)
 
107
endif
 
108
 
 
109
LD_GOLD_BANNER := $(shell $(LD) -v 2>&1 | grep 'GNU gold')
 
110
ifneq ($(LD_GOLD_BANNER),)
 
111
$(warning GNU gold is unsuitable for building iPXE)
 
112
$(warning Use GNU ld instead)
 
113
$(error Unsuitable build environment found)
 
114
endif
106
115
 
107
116
###############################################################################
108
117
#
441
450
 
442
451
# Enable per-item sections and section garbage collection.  Note that
443
452
# some older versions of gcc support -fdata-sections but treat it as
444
 
# implying -fno-common, which would break our build.
 
453
# implying -fno-common, which would break our build.  Some other older
 
454
# versions issue a spurious and uninhibitable warning if
 
455
# -ffunction-sections is used with -g, which would also break our
 
456
# build since we use -Werror.
445
457
#
446
458
ifeq ($(CCTYPE),gcc)
447
459
DS_TEST         = $(ECHO) 'char x;' | \
448
460
                  $(CC) -fdata-sections -S -x c - -o - 2>/dev/null | \
449
461
                  grep -E '\.comm' > /dev/null
450
462
DS_FLAGS        := $(shell $(DS_TEST) && $(ECHO) '-fdata-sections')
451
 
CFLAGS          += -ffunction-sections $(DS_FLAGS)
 
463
FS_TEST         = $(CC) -ffunction-sections -g -c -x c /dev/null \
 
464
                  -o /dev/null 2>/dev/null
 
465
FS_FLAGS        := $(shell $(FS_TEST) && $(ECHO) '-ffunction-sections')
 
466
CFLAGS          += $(FS_FLAGS) $(DS_FLAGS)
452
467
endif
453
468
LDFLAGS         += --gc-sections
454
469
 
540
555
                    '\n$(TGT)_OBJS += $$(BIN)/$(3).$(TGT)\n' ) ) \
541
556
                 '\n$(BIN)/deps/$(1).d : $$($(3)_DEPS)\n' \
542
557
                 '\nTAGS : $$($(3)_DEPS)\n' > $(BIN)/rules/$(1).r
543
 
        @$(PERL) $(PARSEROM) $(1) >> $(BIN)/rules/$(1).r
 
558
        @$(if $(findstring drivers/,$(1)),\
 
559
           $(PERL) $(PARSEROM) $(1) >> $(BIN)/rules/$(1).r)
544
560
endef
545
561
 
546
562
# Rule to generate the dependency list file
591
607
# This is needed in order to correctly rebuild embedded.o whenever the
592
608
# list of objects changes.
593
609
#
 
610
EMBED           := $(EMBEDDED_IMAGE) # Maintain backwards compatibility
594
611
EMBEDDED_LIST   := $(BIN)/.embedded.list
595
612
ifeq ($(wildcard $(EMBEDDED_LIST)),)
596
 
EMBEDDED_IMAGE_OLD := <invalid>
 
613
EMBED_OLD := <invalid>
597
614
else
598
 
EMBEDDED_IMAGE_OLD := $(shell cat $(EMBEDDED_LIST))
 
615
EMBED_OLD := $(shell cat $(EMBEDDED_LIST))
599
616
endif
600
 
ifneq ($(EMBEDDED_IMAGE_OLD),$(EMBEDDED_IMAGE))
601
 
$(shell $(ECHO) "$(EMBEDDED_IMAGE)" > $(EMBEDDED_LIST))
 
617
ifneq ($(EMBED_OLD),$(EMBED))
 
618
$(shell $(ECHO) "$(EMBED)" > $(EMBEDDED_LIST))
602
619
endif
603
620
 
604
621
$(EMBEDDED_LIST) :
605
622
 
606
623
VERYCLEANUP     += $(EMBEDDED_LIST)
607
624
 
608
 
EMBEDDED_FILES  := $(subst $(COMMA), ,$(EMBEDDED_IMAGE))
 
625
EMBEDDED_FILES  := $(subst $(COMMA), ,$(EMBED))
609
626
EMBED_ALL       := $(foreach i,$(call seq,1,$(words $(EMBEDDED_FILES))),\
610
627
                     EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\
611
628
                             \"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))