Date: Sat, 12 Feb 2011 00:06:54 -0800 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Vikash.Badal@is.co.za Cc: freebsd-questions@freebsd.org, Robert Bonomi <bonomi@mail.r-bonomi.com> Subject: Re: switching from gnu make to bsd make Message-ID: <xeiatyg9oew1.fsf@kobe.laptop> In-Reply-To: <201102102359.p1ANxEcA044340@mail.r-bonomi.com> (Robert Bonomi's message of "Thu, 10 Feb 2011 17:59:14 -0600 (CST)") References: <201102102359.p1ANxEcA044340@mail.r-bonomi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 10 Feb 2011 17:59:14 -0600 (CST), Robert Bonomi <bonomi@mail.r-bonomi.com> wrote: >> From: Vikash Badal <Vikash.Badal@is.co.za> >> Date: Thu, 10 Feb 2011 11:30:02 +0200 >> Subject: RE: switching from gnu make to bsd make >> >> > -----Original Message----- >> > From: Polytropon [mailto:freebsd@edvax.de] Sent: 10 February 2011 10:11 >> > AM To: Vikash Badal Cc: freebsd-questions@freebsd.org Subject: Re: >> > switching from gnu make to bsd make >> > >> > Of course, in my testing case OBJDIR and SRCDIR are empty, and I >> > didn't define any of CC, CFLAGS, INCDIR or LIBDIR, so the defaults >> > have been chosen. >> > >> > Do you encounter a specific problem? >> >> This is my problem: >> >> vix:$ make make: don't know how to make src/%.c. Stop > > Just telling people "what happened" is *NOT* enough for intelligent > diagnosis of the problem. You also have to tell people WHAT YOU DID > that provoked the error you encountered. > > That said, dusting off my crystal ball -- which appears to be *working* > today -- you simply typed "make" at the shell prompt. > > Try typing "make all" and see what happens then. Right. this should fix the immediate problem. The 'bug' seems to be that the Makefile lists the '$(OBJDIR)/%.o' target *first*. >> this is my make file: >> >> ------------------------------------------------------------------------------ >> >> CC = cc > * LIBS = -lpthread -lmysqlclient_r >> CFLAGS = -Wall -g >> INCDIR = -Iinclude -I/usr/local/include -I/usr/local/include/mysql >> LIBDIR = -L/usr/local/lib -L/usr/local/lib/mysql >> OBJDIR = obj >> SRCDIR = src >> BINDIR = bin >> PREFIX = /usr/local/nntpd >> BINDIRFILES = ${BINDIR}/nntpd >> OBJS = ${OBJDIR}/log.o ${OBJDIR}/cleanup.o ${OBJDIR}/config.o \ >> ${OBJDIR}/leecherpool.o ${OBJDIR}/mytime.o >> ${OBJDIR}/upstream.o ${OBJDIR}/mysleep.o >> ${OBJDIR}/sql.o ${OBJDIR}/signalhandler.o >> ${OBJDIR}/list.o ${OBJDIR}/tcpserver.o >> ${OBJDIR}/listenpool.o ${OBJDIR}/workers.o \ >> ${OBJDIR}/nntpd.o >> >> $(OBJDIR)/%.o:${SRCDIR}/%.c >> ${CC} -c ${CFLAGS} ${INCDIR} ${LIBDIR} $< -o $@ >> >> all: ${OBJS} >> ${CC} -o ${BINDIR}/nntpd ${LIBS} ${CFLAGS} ${INCDIR} ${LIBDIR} \ >> ${OBJDIR}/log.o ${OBJDIR}/cleanup.o ${OBJDIR}/config.o \ >> ${OBJDIR}/leecherpool.o ${OBJDIR}/mytime.o ${OBJDIR}/nntp.o \ >> ${OBJDIR}/upstream.o ${OBJDIR}/mysleep.o ${OBJDIR}/sqlpool.o \ >> ${OBJDIR}/sql.o ${OBJDIR}/signalhandler.o ${OBJDIR}/daemon.o \ >> ${OBJDIR}/list.o ${OBJDIR}/tcpserver.o ${OBJDIR}/tmpfiles.o \ >> ${OBJDIR}/listenpool.o ${OBJDIR}/workers.o \ >> ${OBJDIR}/nntpd.o Try swapping the order of the two targets above. BSD make(1) considers the first target the 'default', so when you just type 'make' it tries to build a target named '$(OBJDIR)/%.o', which fails.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xeiatyg9oew1.fsf>