[patch/rebase]: Makefile support for cross-builds and static linking with gcc-4

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jun 20 15:30:00 GMT 2011

Hi Jason,

This patch changes Makefile to use $(EXEEXT) throughout to better support
cross building.  It also adds explicit static linking to avoid to link
against cyggcc_s-1.dll and cygstdc++-6.dll.

Ok to apply?


Index: Makefile
RCS file: /sourceware/projects/cygwin-apps-home/cvsfiles/rebase/Makefile,v
retrieving revision
diff -u -p -r1.1.1.1 Makefile
--- Makefile	20 Jun 2011 14:22:01 -0000
+++ Makefile	20 Jun 2011 15:29:02 -0000
@@ -17,12 +17,15 @@ DOCDIR = $(PREFIX)/share/doc/Cygwin
 INSTALL = install
 CFLAGS = -O2 -I imagehelper
+LDFLAGS = -static -static-libgcc -static-libstdc++
-all: rebase peflags
+EXEEXT = .exe
+all: rebase$(EXEEXT) peflags$(EXEEXT)
 .PHONY: imagehelper
-rebase: imagehelper $(Objects)
+rebase$(EXEEXT): imagehelper $(Objects)
 	$(CXX) $(LDFLAGS) -o $@ $(Objects) $(Libs)
 rebase.o: rebase.c Makefile
@@ -30,7 +33,7 @@ rebase.o: rebase.c Makefile
 	-DLIB_VERSION='"$(LibVersion)"' \
 	-c -o $@ $<
-peflags: peflags.o
+peflags$(EXEEXT): peflags.o
 	$(CC) $(LDFLAGS) -o $@ peflags.o
 peflags.o: peflags.c Makefile
@@ -56,7 +59,7 @@ dist: all
 	rm -f ../rebase-$(Version)
-	$(RM) -fr *.o *.exe
+	$(RM) -fr *.o rebase$(EXEEXT) peflags$(EXEEXT)
 realclean: clean
 	$(MAKE) -C imagehelper clean

Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-apps mailing list