delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/03/13/13:26:53

Message-Id: <9603131824.AA04941@zen.mc.xerox.com>
To: djgpp-workers AT delorie DOT com
Subject: cross making djgpp
Date: Wed, 13 Mar 1996 10:24:15 PST
From: "Marty Leisner" <leisner AT sdsp DOT mc DOT xerox DOT com>


In order to make the makefile more flexible (and allow cross-development
easier)

1) use CC=gcc, and $(CC) 
instead of hard coding gcc.

Do something like

$(BINPATH)/foo$(EXE):	$(OBJS)


where defaults for BINPATH=../../../bin
		   EXE=.exe

to allow easy cross-generation 
(i.e. make BINPATH=. EXE=

For example, in texi2ps, I did:

===================================================================
RCS file: makefile,v
retrieving revision 1.1
diff -u -r1.1 makefile
--- makefile	1996/03/13 05:44:35	1.1
+++ makefile	1996/03/13 05:45:37
@@ -1,7 +1,9 @@
 # Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details
 CFLAGS = -O2 -Wimplicit
 LDFLAGS = -s
+CC=gcc
 
+BINPATH=../../../bin
 OBJS = \
 	fileio.o \
 	ps.o \
@@ -10,12 +12,14 @@
 	word.o \
 	ifset.o \
 	$E
+EXE=.exe
 
-../../../bin/texi2ps.exe: $(OBJS)
-	gcc $(LDFLAGS) -o $@ $(OBJS)
+
+$(BINPATH)/texi2ps$(EXE): $(OBJS)
+	$(CC) $(LDFLAGS) -o $@ $(OBJS)
 
 %.o: %.c
-	gcc -MMD -c $(CFLAGS) $<
+	$(CC) -MMD -c $(CFLAGS) $<
 
 clean:
 	-rm -f *.o *.exe *.d

Also, would it be bad to build the info files in the current directory
and then move them?  This is what I do (I edit the info files not
to move them elsewhere...)

marty		leisner AT sdsp DOT mc DOT xerox DOT com   
Member of the League for Programming Freedom (http://www.lpf.org)
Any sufficiently advanced technology is indistinguishable from magic
        Arthur C. Clarke, The Lost Worlds of 2001

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019