compiling FreeBSD date on Linux
Giorgos Keramidas
keramida at ceid.upatras.gr
Thu May 21 03:16:18 UTC 2009
On Wed, 20 May 2009 14:45:59 -0300, francis keyes <fkeymo at 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''.
More information about the freebsd-questions
mailing list