Skip to contentSkip to conversation

Fixes for makefiles

PATCH New Stefan Berger 1 participant 1 message Jan 6, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixes for makefiles

This patch fixes some problems in makefiles of this previously posted patch:

http://lists.xensource.com/archives/html/xen-devel/2007-01/msg00071.html

xen-unstable.hg/tools/firmware/rombios/32bit/Makefile +15 -16
Index: root/xen-unstable.hg/tools/firmware/rombios/32bit/Makefile
===================================================================
@@ -7,33 +7,32 @@ CFLAGS += -I../
 
 SUBDIRS = tcgbios
 
-MODULES = 32bitbios.o
-MODULES += tcgbios/tcgbiosext.o
-MODULES += util.o
+MODULES = tcgbios/tcgbiosext.o
 
-.PHONY: all subdirs
+.PHONY: all subdirs clean
 
-all : subdirs $(TARGET)
+all : $(TARGET)
 
 subdirs :
 	@for subdir in $(SUBDIRS); do \
 		$(MAKE) -C $$subdir all; \
 	done; \
 
-clean ::
+clean :
 	rm -rf *.o $(TARGET)
 	@for subdir in $(SUBDIRS); do \
 		$(MAKE) -C $$subdir $@; \
 	done; \
 
-$(TARGET) : 32bitbios_all.o $(SOURCES)
-	unref=`nm -u 32bitbios_all.o`
-	if [ "$$unref" != "" ]; then \
-		echo "There are unresolved symbols in the BIOS.";	\
-		echo $$unref ;						\
-	else								\
-		bash mkhex highbios_array 32bitbios_all.o > $(TARGET); \
-	fi
+%.o : %.c
+	gcc $(CFLAGS) -c $^ -o $@
 
-32bitbios_all.o : $(MODULES)
-	ld -r $(MODULES) -o 32bitbios_all.o
+$(TARGET) : subdirs 32bitbios.o util.o
+	ld -r 32bitbios.o $(MODULES) util.o -o 32bitbios_all.o
+	@nm 32bitbios_all.o |                                \
+	  grep -E -q '^ +U ' && {                            \
+	    echo "There are undefined symbols in the BIOS:"; \
+	    nm -u 32bitbios_all.o;                           \
+	    exit 11;                                         \
+	  } || :
+	bash mkhex highbios_array 32bitbios_all.o > $@
xen-unstable.hg/tools/firmware/rombios/32bit/tcgbios/Makefile +3 -1
Index: root/xen-unstable.hg/tools/firmware/rombios/32bit/tcgbios/Makefile
===================================================================
@@ -6,9 +6,11 @@ CFLAGS  = -Wall -Werror -Wunused -Werror
 CFLAGS += -fomit-frame-pointer -fno-builtin -nostdlib
 CFLAGS += -I../ -I../../
 
+.PHONY: all clean
+
 all : $(TARGET)
 
-clean::
+clean :
 	rm -rf *.o $(TARGET)
 
 %.o : %.c

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel