2010/6/14 Carl-Daniel Hailfinger <span dir="ltr"><<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 14.06.2010 15:18, Carl-Daniel Hailfinger wrote:<br>
> Handle OS where executables have a hardcoded suffix, e.g. DOS with .exe .<br>
> This ensures that any temp files in the configure/check step of the<br>
> Makefile are removed correctly.<br>
><br>
<br>
</div>Idwer pointed out that the flashrom Makefile target and a few other<br>
places were missing executable suffix handling. Fix.<br>
<div class="im"><br>
Signed-off-by: Carl-Daniel Hailfinger <<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>><br></div></blockquote><div><br>Acked-by: Idwer Vollering <<a href="mailto:vidwer%2Bflashrom@gmail.com">vidwer+flashrom@gmail.com</a>><br>
<br>With one comment further in this message:<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
<br>
Index: flashrom-dos_exec_suffix/Makefile<br>
===================================================================<br>
--- flashrom-dos_exec_suffix/Makefile   (Revision 1045)<br>
+++ flashrom-dos_exec_suffix/Makefile   (Arbeitskopie)<br>
@@ -49,6 +49,7 @@<br>
 LDFLAGS += -L/usr/local/lib<br>
 endif<br>
 ifeq ($(OS_ARCH), DOS)<br>
+EXEC_SUFFIX := .exe<br>
 CPPFLAGS += -I../libgetopt -I../libpci/include<br>
 # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt<br>
 LIBS += ../libgetopt/libgetopt.a<br>
</div>@@ -67,7 +68,7 @@<br>
<br>
 PROGRAMMER_OBJS = udelay.o programmer.o<br>
<br>
-all: pciutils features $(PROGRAM)<br>
+all: pciutils features $(PROGRAM)$(EXEC_SUFFIX)<br>
<br>
 # Set the flashrom version string from the highest revision number<br>
 # of the checked out flashrom files.<br>
@@ -255,8 +256,8 @@<br>
<div class="im"><br>
 OBJS = $(CHIP_OBJS) $(CLI_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)<br>
<br>
-$(PROGRAM): $(OBJS)<br>
-       $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(FEATURE_LIBS) $(LIBS)<br>
</div>+$(PROGRAM)$(EXEC_SUFFIX): $(OBJS)<br>
<div class="im">+       $(CC) $(LDFLAGS) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(FEATURE_LIBS) $(LIBS)<br>
<br>
 # TAROPTIONS reduces information leakage from the packager's system.<br>
 # If other tar programs support command line arguments for setting uid/gid of<br>
</div>@@ -268,23 +269,24 @@<br>
<br>
 # Make sure to add all names of generated binaries here.<br>
 # This includes all frontends and libflashrom.<br>
+# We don't use EXEC_SUFFIX here because we want to clean everything.<br></blockquote><div><br>It's used everywhere except here ?<br><br>Changing "clean" to the syntax below doesn't work as expected anyway:<br>
 clean:<br>-       rm -f $(PROGRAM) $(PROGRAM).exe *.o *.d<br>+       rm -f $(PROGRAM) $(PROGRAM)$(EXEC_SUFFIX) *.o *.d<br><br><br>$ make distclean<br>rm -f flashrom flashrom *.o *.d<br>rm -f .features .libdeps<br><br><br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
 clean:<br>
        rm -f $(PROGRAM) $(PROGRAM).exe *.o *.d<br>
<br>
 distclean: clean<br>
        rm -f .features .libdeps<br>
<br>
-strip: $(PROGRAM)<br>
-       $(STRIP) $(STRIP_ARGS) $(PROGRAM)<br>
+strip: $(PROGRAM)$(EXEC_SUFFIX)<br>
+       $(STRIP) $(STRIP_ARGS) $(PROGRAM)$(EXEC_SUFFIX)<br>
<br>
 compiler:<br>
<div class="im">        @printf "Checking for a C compiler... "<br>
        @$(shell ( echo "int main(int argc, char **argv)"; \<br>
                   echo "{ return 0; }"; ) > .test.c )<br>
-       @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .test.c -o .test >/dev/null &&  \<br>
+       @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .test.c -o .test$(EXEC_SUFFIX) >/dev/null &&    \<br>
                echo "found." || ( echo "not found."; \<br>
-               rm -f .test.c .test; exit 1)<br>
-       @rm -f .test.c .test<br>
+               rm -f .test.c .test$(EXEC_SUFFIX); exit 1)<br>
+       @rm -f .test.c .test$(EXEC_SUFFIX)<br>
<br>
 ifeq ($(CHECK_LIBPCI), yes)<br>
 pciutils: compiler<br>
</div>@@ -300,15 +302,15 @@<br>
<div class="im">                rm -f .test.c .test.o; exit 1)<br>
        @printf "Checking if libpci is present and sufficient... "<br>
        @printf "" > .libdeps<br>
-       @$(CC) $(LDFLAGS) .test.o -o .test $(LIBS) >/dev/null 2>&1 &&                           \<br>
+       @$(CC) $(LDFLAGS) .test.o -o .test$(EXEC_SUFFIX) $(LIBS) >/dev/null 2>&1 &&                             \<br>
                echo "yes." || ( echo "no.";                                                    \<br>
                printf "Checking if libz+libpci are present and sufficient..."; \<br>
-               $(CC) $(LDFLAGS) .test.o -o .test $(LIBS) -lz >/dev/null 2>&1 &&                \<br>
+               $(CC) $(LDFLAGS) .test.o -o .test$(EXEC_SUFFIX) $(LIBS) -lz >/dev/null 2>&1 &&          \<br>
                ( echo "yes."; echo "NEEDLIBZ := yes" > .libdeps ) || ( echo "no."; echo;       \<br>
                echo "Please install libpci (package pciutils) and/or libz.";                   \<br>
                echo "See README for more information."; echo;                          \<br>
-               rm -f .test.c .test.o .test; exit 1) )<br>
-       @rm -f .test.c .test.o .test<br>
+               rm -f .test.c .test.o .test$(EXEC_SUFFIX); exit 1) )<br>
+       @rm -f .test.c .test.o .test$(EXEC_SUFFIX)<br>
 else<br>
 pciutils: compiler<br>
        @printf "" > .libdeps<br>
</div>@@ -324,7 +326,7 @@<br>
<div class="im">                   echo "struct ftdi_context *ftdic = NULL;";      \<br>
                   echo "int main(int argc, char **argv)"; \<br>
                   echo "{ return ftdi_init(ftdic); }"; ) > .featuretest.c )<br>
-       @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest $(FTDILIBS) $(LIBS) >/dev/null 2>&1 &&   \<br>
+       @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) $(FTDILIBS) $(LIBS) >/dev/null 2>&1 &&     \<br>
                ( echo "found."; echo "FTDISUPPORT := yes" >> .features.tmp ) ||        \<br>
                ( echo "not found."; echo "FTDISUPPORT := no" >> .features.tmp )<br>
        @printf "Checking for utsname support... "<br>
</div>@@ -332,11 +334,11 @@<br>
<div class="im">                   echo "struct utsname osinfo;";          \<br>
                   echo "int main(int argc, char **argv)"; \<br>
                   echo "{ uname (&osinfo); return 0; }"; ) > .featuretest.c )<br>
-       @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest >/dev/null 2>&1 &&       \<br>
+       @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \<br>
                ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) ||    \<br>
                ( echo "not found."; echo "UTSNAME := no" >> .features.tmp )<br>
        @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features<br>
-       @rm -f .featuretest.c .featuretest<br>
+       @rm -f .featuretest.c .featuretest$(EXEC_SUFFIX)<br>
 else<br>
 features: compiler<br>
        @echo "FEATURES := yes" > .features.tmp<br>
</div>@@ -345,17 +347,17 @@<br>
<div class="im">                   echo "struct utsname osinfo;";          \<br>
                   echo "int main(int argc, char **argv)"; \<br>
                   echo "{ uname (&osinfo); return 0; }"; ) > .featuretest.c )<br>
-       @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest >/dev/null 2>&1 &&       \<br>
+       @$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) .featuretest.c -o .featuretest$(EXEC_SUFFIX) >/dev/null 2>&1 && \<br>
                ( echo "found."; echo "UTSNAME := yes" >> .features.tmp ) ||    \<br>
                ( echo "not found."; echo "UTSNAME := no" >> .features.tmp )<br>
        @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features<br>
-       @rm -f .featuretest.c .featuretest<br>
+       @rm -f .featuretest.c .featuretest$(EXEC_SUFFIX)<br>
 endif<br>
<br>
-install: $(PROGRAM)<br>
</div>+install: $(PROGRAM)$(EXEC_SUFFIX)<br>
        mkdir -p $(DESTDIR)$(PREFIX)/sbin<br>
        mkdir -p $(DESTDIR)$(MANDIR)/man8<br>
-       $(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin<br>
+       $(INSTALL) -m 0755 $(PROGRAM)$(EXEC_SUFFIX) $(DESTDIR)$(PREFIX)/sbin<br>
        $(INSTALL) -m 0644 $(PROGRAM).8 $(DESTDIR)$(MANDIR)/man8<br>
<br>
 export:<br>
<div><div></div><div class="h5"><br>
<br>
--<br>
<a href="http://www.hailfinger.org/" target="_blank">http://www.hailfinger.org/</a><br>
<br>
<br>
_______________________________________________<br>
flashrom mailing list<br>
<a href="mailto:flashrom@flashrom.org">flashrom@flashrom.org</a><br>
<a href="http://www.flashrom.org/mailman/listinfo/flashrom" target="_blank">http://www.flashrom.org/mailman/listinfo/flashrom</a><br>
</div></div></blockquote></div><br>