Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 May 2009 06:16:13 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        francis keyes <fkeymo@gmail.com>
Cc:        Polytropon <freebsd@edvax.de>, Chuck Robey <chuckr@telenix.org>, freebsd-questions@freebsd.org
Subject:   Re: compiling FreeBSD date on Linux
Message-ID:  <87fxez5eo2.fsf@kobe.laptop>
In-Reply-To: <d64607cc0905201045i36084a34g2a6c0d4e9d5f750d@mail.gmail.com> (francis keyes's message of "Wed, 20 May 2009 14:45:59 -0300")
References:  <d64607cc0905191419p621f7e65tf5515d1d3696bfa0@mail.gmail.com> <20090520000137.3d46fcb2.freebsd@edvax.de> <4A135119.8010007@telenix.org> <d64607cc0905201045i36084a34g2a6c0d4e9d5f750d@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 20 May 2009 14:45:59 -0300, francis keyes <fkeymo@gmail.com> wrote:
> Hmm... the date program looks pretty simple but I don't understand the
> Makfile:
>
> #    @(#)Makefile    8.1 (Berkeley) 5/31/93
> # $FreeBSD: src/bin/date/Makefile,v 1.11.30.1 2009/04/15 03:14:26 kensmith
> Exp $
>
> PROG=    date
> SRCS=    date.c netdate.c vary.c
> DPADD=    ${LIBUTIL}
> LDADD=    -lutil
>
> .include <bsd.prog.mk>
>
> Would it be possible to compile this without a makefile?

Yes, but you will also need bits of code from libutil.  If you have all
the necessary bits in a new file, i.e. util.c, then you should be able
to use:

    cc -o date date.c netdate.c vary.c util.c

Extracting the minimal parts of libutil and writing the new util.c file
is an interesting and amusing exercise for a budding C programmer, but
it should be both possible and relatively ``easy''.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87fxez5eo2.fsf>