We have to fix this!

Pawel Jakub Dawidek pjd at FreeBSD.org
Tue Mar 9 06:05:46 PST 2004


Hi.

it is really irritating that connecting files from other directory
is not possible.

For example:

	% cat Makefile
	PROG=test
	SRCS=../test.c
	NOMAN=what_for
	.include <bsd.prog.mk>

	% make
	cc -O -pipe   -c ../test.c
	cc -O -pipe    -o test ../test.o 
	cc: ../test.o: No such file or directory
	cc: No input files specified
	*** Error code 1
	
	Stop in /usr/home/pjd/src/test.

	% ls ../test.o test.o
	ls: ../test.o: No such file or directory
	test.o

	% make -n
	cc -O -pipe   -c ../test.c
	cc -O -pipe    -o test ../test.o 

It is created in wrong directory, because there is no '-o' specified.

This simple path fix building .c files, but other should be fixed as well.

Index: sys.mk
===================================================================
RCS file: /private/FreeBSD/src/share/mk/sys.mk,v
retrieving revision 1.75
diff -u -p -r1.75 sys.mk
--- sys.mk	4 Feb 2004 14:40:44 -0000	1.75
+++ sys.mk	9 Mar 2004 14:02:21 -0000
@@ -184,7 +184,7 @@ MACHINE_ARCH	?=	i386
 	${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
 
 .c.o:
-	${CC} ${CFLAGS} -c ${.IMPSRC}
+	${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
 
 .cc .cpp .cxx .C:
 	${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}

Could someone commit this, PLEASE?

PS. I'm building world right now to be sure nothing depend on it,
    but I have no idea how something may depend on this.

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd at FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20040309/638782e1/attachment.bin


More information about the freebsd-arch mailing list