switching from gnu make to bsd make
Giorgos Keramidas
keramida at ceid.upatras.gr
Sat Feb 12 08:07:15 UTC 2011
On Thu, 10 Feb 2011 17:59:14 -0600 (CST), Robert Bonomi <bonomi at mail.r-bonomi.com> wrote:
>> From: Vikash Badal <Vikash.Badal at 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 at edvax.de] Sent: 10 February 2011 10:11
>> > AM To: Vikash Badal Cc: freebsd-questions at 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.
More information about the freebsd-questions
mailing list