From: niklas Date: Sat, 9 Mar 1996 01:33:25 +0000 (+0000) Subject: Rudimentary support for compilation in a cross environment X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=da34e3c3d40263be91967714eaa1a2c4390ea117;p=openbsd Rudimentary support for compilation in a cross environment Host tools will be compiled with HOSTCC instead of CC. Note, these are not complete in *any* way\! --- diff --git a/games/adventure/Makefile b/games/adventure/Makefile index 8c2df60cc20..db789789b10 100644 --- a/games/adventure/Makefile +++ b/games/adventure/Makefile @@ -1,3 +1,4 @@ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:25 niklas Exp $ # $NetBSD: Makefile,v 1.3 1995/03/21 12:04:53 cgd Exp $ # @(#)Makefile 8.1 (Berkeley) 6/12/93 @@ -12,6 +13,6 @@ data.c: glorkz setup ./setup ${.CURDIR}/glorkz > data.c setup: setup.c hdr.h - ${CC} -o setup ${.CURDIR}/setup.c + ${HOSTCC} -o setup ${.CURDIR}/setup.c .include diff --git a/games/fortune/strfile/Makefile b/games/fortune/strfile/Makefile index a8847445274..f1e40ad15ad 100644 --- a/games/fortune/strfile/Makefile +++ b/games/fortune/strfile/Makefile @@ -1,7 +1,15 @@ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:26 niklas Exp $ # $NetBSD: Makefile,v 1.5 1995/03/23 08:28:44 cgd Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 -PROG= strfile +PROG= MAN= strfile.8 +CLEANFILES+= strfile + +all: strfile + +strfile: ${.CURDIR}/strfile.c + ${HOSTCC} ${CFLAGS} ${.CURDIR}/strfile.c -o $@ + .include diff --git a/games/hack/Makefile b/games/hack/Makefile index 4fa0fc045d0..aeeaae420b3 100644 --- a/games/hack/Makefile +++ b/games/hack/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 1995/03/23 08:29:07 cgd Exp $ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:28 niklas Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 PROG= hack @@ -27,7 +27,7 @@ hack.onames.h: makedefs def.objects.h ${.OBJDIR}/makedefs ${.CURDIR}/def.objects.h > hack.onames.h makedefs: makedefs.c - ${CC} ${CFLAGS} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${.CURDIR}/${.PREFIX}.c ${LDADD} + ${HOSTCC} ${CFLAGS} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${.CURDIR}/${.PREFIX}.c ${LDADD} beforeinstall: install -c -o games -g games -m 600 /dev/null \ diff --git a/games/monop/Makefile b/games/monop/Makefile index 0b692e3d6c4..711fe8884dd 100644 --- a/games/monop/Makefile +++ b/games/monop/Makefile @@ -1,3 +1,4 @@ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:29 niklas Exp $ # $NetBSD: Makefile,v 1.12 1995/03/23 08:34:32 cgd Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 @@ -16,7 +17,7 @@ cards.pck: initdeck ${.OBJDIR}/initdeck ${.CURDIR}/cards.inp initdeck: initdeck.c - ${CC} ${CFLAGS} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${.CURDIR}/initdeck.c ${LDADD} + ${HOSTCC} ${CFLAGS} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${.CURDIR}/initdeck.c ${LDADD} beforeinstall: install -c -o ${BINOWN} -g ${BINGRP} -m 444 cards.pck \ diff --git a/games/phantasia/Makefile b/games/phantasia/Makefile index aa068e8bd64..4b82358160b 100644 --- a/games/phantasia/Makefile +++ b/games/phantasia/Makefile @@ -1,3 +1,4 @@ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:30 niklas Exp $ # $NetBSD: Makefile,v 1.4 1995/03/24 03:58:22 cgd Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 @@ -11,8 +12,14 @@ CLEANFILES+=map setup setup.o all: setup phantasia -setup: phantglobs.o setup.o monsters.asc ${LIBM} - ${CC} phantglobs.o setup.o -o ${.TARGET} -lm +setup.o: setup.c + ${HOSTCC} -c setup.c -o ${.TARGET} + +phantglobs.o.bld: phantglobs.c + ${HOSTCC} -c phantglobs.c -o ${.TARGET} + +setup: phantglobs.o.bld setup.o monsters.asc ${LIBM} + ${HOSTCC} phantglobs.o.bld setup.o -o ${.TARGET} -lm beforeinstall: ./setup -m ${.CURDIR}/monsters.asc @@ -22,7 +29,7 @@ beforeinstall: # PLOTDEVICE is used for plotting the map. Change as appropriate. map: map.c - ${CC} -O ${.CURDIR}/map.c -lplot -o ${.TARGET} + ${HOSTCC} -O ${.CURDIR}/map.c -lplot -o ${.TARGET} ./map | plot > /dev/tty # XXX this rule shouldn't be here. diff --git a/share/mk/sys.mk b/share/mk/sys.mk index ec11555db73..b0617abee4f 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -1,4 +1,4 @@ -# $OpenBSD: sys.mk,v 1.4 1996/03/05 11:13:06 mickey Exp $ +# $OpenBSD: sys.mk,v 1.5 1996/03/09 01:33:31 niklas Exp $ # $NetBSD: sys.mk,v 1.22 1995/09/24 23:49:09 christos Exp $ # @(#)sys.mk 5.11 (Berkeley) 3/13/91 @@ -24,6 +24,8 @@ CFLAGS?= -O COMPILE.c?= ${CC} ${CFLAGS} ${CPPFLAGS} -c LINK.c?= ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} +HOSTCC?= cc + CXX?= g++ CXXFLAGS?= ${CFLAGS} COMPILE.cc?= ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c diff --git a/usr.bin/tn3270/tools/Makefile b/usr.bin/tn3270/tools/Makefile index bf2d8685e30..1233e3be51b 100644 --- a/usr.bin/tn3270/tools/Makefile +++ b/usr.bin/tn3270/tools/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1.1.1 1995/10/18 08:46:23 deraadt Exp $ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:33 niklas Exp $ SUBDIR = mkhits mkastosc mkastods mkdstoas mkdctype diff --git a/usr.bin/tn3270/tools/Makefile.inc b/usr.bin/tn3270/tools/Makefile.inc new file mode 100644 index 00000000000..944d3ec4e01 --- /dev/null +++ b/usr.bin/tn3270/tools/Makefile.inc @@ -0,0 +1,4 @@ +# $OpenBSD: Makefile.inc,v 1.1 1996/03/09 01:33:34 niklas Exp $ + +CC=${HOSTCC} +DESTDIR=/ diff --git a/usr.bin/tn3270/tools/mkastods/Makefile b/usr.bin/tn3270/tools/mkastods/Makefile index 45a649f5ff6..0b08a73c0e0 100644 --- a/usr.bin/tn3270/tools/mkastods/Makefile +++ b/usr.bin/tn3270/tools/mkastods/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1.1.1 1995/10/18 08:46:23 deraadt Exp $ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:35 niklas Exp $ CFLAGS += -I${.CURDIR}/.. -I. diff --git a/usr.bin/tn3270/tools/mkastosc/Makefile b/usr.bin/tn3270/tools/mkastosc/Makefile index 93d3465a625..bbcebf63cd7 100644 --- a/usr.bin/tn3270/tools/mkastosc/Makefile +++ b/usr.bin/tn3270/tools/mkastosc/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1.1.1 1995/10/18 08:46:24 deraadt Exp $ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:36 niklas Exp $ CFLAGS += -I${.CURDIR}/../mkhits -I${.CURDIR}/.. -I. diff --git a/usr.bin/tn3270/tools/mkdctype/Makefile b/usr.bin/tn3270/tools/mkdctype/Makefile index 45e20467db1..420aba6a74d 100644 --- a/usr.bin/tn3270/tools/mkdctype/Makefile +++ b/usr.bin/tn3270/tools/mkdctype/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1.1.1 1995/10/18 08:46:24 deraadt Exp $ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:37 niklas Exp $ CFLAGS += -I${.CURDIR}/.. -I. diff --git a/usr.bin/tn3270/tools/mkdstoas/Makefile b/usr.bin/tn3270/tools/mkdstoas/Makefile index 17a28fc2e2e..89bc021b2ac 100644 --- a/usr.bin/tn3270/tools/mkdstoas/Makefile +++ b/usr.bin/tn3270/tools/mkdstoas/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1.1.1 1995/10/18 08:46:24 deraadt Exp $ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:39 niklas Exp $ CFLAGS += -I${.CURDIR}/.. -I. diff --git a/usr.bin/tn3270/tools/mkhits/Makefile b/usr.bin/tn3270/tools/mkhits/Makefile index 3d4155dc974..54febaeb332 100644 --- a/usr.bin/tn3270/tools/mkhits/Makefile +++ b/usr.bin/tn3270/tools/mkhits/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1.1.1 1995/10/18 08:46:25 deraadt Exp $ +# $OpenBSD: Makefile,v 1.2 1996/03/09 01:33:40 niklas Exp $ CFLAGS += -I${.CURDIR}/.. -I.