From 25ae53b1655271197d8c458cdbab046895b68a97 Mon Sep 17 00:00:00 2001 From: Dirk Vogt Date: Tue, 1 May 2012 15:13:07 +0200 Subject: [PATCH] Make commands cross-compilable --- commands/ash/Makefile | 13 +++++++++---- commands/ash/mkinit.c | 4 ++++ commands/ash/mksyntax.c | 4 ++++ commands/awk/Makefile | 8 ++++++-- commands/fsck.mfs/Makefile | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/commands/ash/Makefile b/commands/ash/Makefile index 05ed3bc37..77a288b7c 100644 --- a/commands/ash/Makefile +++ b/commands/ash/Makefile @@ -56,10 +56,15 @@ init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \ redir.c trap.c var.c ./mkinit ${.ALLSRC:S/^mkinit$//} -mkinit: mkinit.o -mknodes: mknodes.o -mksyntax: mksyntax.o -mksignames: mksignames.o +mkinit: mkinit.lo + ${HOST_LINK.c} mkinit.lo -o $@ + +mknodes: mknodes.lo + ${HOST_LINK.c} mknodes.lo -o $@ +mksyntax: mksyntax.lo + ${HOST_LINK.c} mksyntax.lo -o $@ +mksignames: mksignames.lo + ${HOST_LINK.c} mksignames.lo -o $@ .ORDER: nodes.c nodes.h nodes.c nodes.h: mknodes nodetypes nodes.c.pat diff --git a/commands/ash/mkinit.c b/commands/ash/mkinit.c index 4a3451fd9..962631fc8 100644 --- a/commands/ash/mkinit.c +++ b/commands/ash/mkinit.c @@ -165,6 +165,10 @@ static void error(char *); #define equal(s1, s2) (strcmp(s1, s2) == 0) +#ifndef __unused +#define __unused __attribute__((__unused__)) +#endif + int main(int argc __unused, char *argv[]) { diff --git a/commands/ash/mksyntax.c b/commands/ash/mksyntax.c index 830f11a3d..40b825052 100644 --- a/commands/ash/mksyntax.c +++ b/commands/ash/mksyntax.c @@ -115,6 +115,10 @@ static void print(char *); static void output_type_macros(void); static void digit_convert(void); +#ifndef __unused +#define __unused __attribute__((__unused__)) +#endif + int main(int argc __unused, char **argv __unused) { diff --git a/commands/awk/Makefile b/commands/awk/Makefile index 6ceb42417..ea7d01eca 100644 --- a/commands/awk/Makefile +++ b/commands/awk/Makefile @@ -14,8 +14,12 @@ build-tools: maketab proctab.c: maketab ./maketab > proctab.c -maketab: awkgram.h maketab.c +maketab.lo: awkgram.h -CLEANFILES= maketab proctab.c + +maketab: maketab.lo + ${HOST_LINK.c} maketab.lo -o $@ + +CLEANFILES= maketab proctab.c maketab.lo .include diff --git a/commands/fsck.mfs/Makefile b/commands/fsck.mfs/Makefile index 7200c6970..8445c72a8 100644 --- a/commands/fsck.mfs/Makefile +++ b/commands/fsck.mfs/Makefile @@ -1,4 +1,4 @@ -FSCK= ${NETBSDSRCDIR}/sbin/fsck +FSCK= ${MINIXSRCDIR}/sbin/fsck PROG= fsck.mfs SRCS= fsck.c CPPFLAGS+= -I${MINIXSRCDIR}/servers -I${FSCK} -- 2.44.0