Discussion:
makefile question
Hartmut Brandt
2018-06-27 19:33:09 UTC
Permalink
Hi,

I'm preparing an update for bsnmp and have the following problem:

In libbsnmp a header file is created during the build process, which
obviously ends up in the object tree. Now I need to include this file
when building the daemon and modules from usr.sbin. I have the feeling
that doing

CFLAGS += -I../../../lib/libbsnmp/libbsnmp

in usr.sbin/bsnmp/bsnmp to reach into the library object directory doesn't
look right.

Or is this the right way to do this?

harti
Craig Leres
2018-06-27 19:39:10 UTC
Permalink
Post by Hartmut Brandt
In libbsnmp a header file is created during the build process, which
obviously ends up in the object tree. Now I need to include this file
when building the daemon and modules from usr.sbin. I have the feeling
that doing
CFLAGS += -I../../../lib/libbsnmp/libbsnmp
in usr.sbin/bsnmp/bsnmp to reach into the library object directory
doesn't look right.
Or is this the right way to do this?
Check out usr.bin/w/Makefile, it uses a module from bin/ps.

Craig

# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD: releng/11.2/usr.bin/w/Makefile 319186 2017-05-30 04:27:05Z
ngie $

PROG= w
SRCS= fmt.c pr_time.c proc_compare.c w.c
MAN= w.1 uptime.1
LIBADD= kvm sbuf xo util
LINKS= ${BINDIR}/w ${BINDIR}/uptime

.PATH: ${SRCTOP}/bin/ps

.include <bsd.prog.mk>
Warner Losh
2018-06-27 19:41:25 UTC
Permalink
Post by Hartmut Brandt
Hi,
In libbsnmp a header file is created during the build process, which
obviously ends up in the object tree. Now I need to include this file
when building the daemon and modules from usr.sbin. I have the feeling
that doing
CFLAGS += -I../../../lib/libbsnmp/libbsnmp
use ${SRCTOP}/lib/... here

Warner
Post by Hartmut Brandt
in usr.sbin/bsnmp/bsnmp to reach into the library object directory doesn't
look right.
Or is this the right way to do this?
harti
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
Simon J. Gerraty
2018-06-27 20:08:26 UTC
Permalink
Post by Warner Losh
Post by Hartmut Brandt
In libbsnmp a header file is created during the build process, which
obviously ends up in the object tree. Now I need to include this file
when building the daemon and modules from usr.sbin. I have the feeling
that doing
CFLAGS += -I../../../lib/libbsnmp/libbsnmp
use ${SRCTOP}/lib/... here
I think he said it's a generated header.

Looks like share/mk/src.sys.obj.mk now sets OBJTOP
or at least OBJROOT even for non-meta-mode build.

So -I${OBJTOP}/lib/libbsnmp/libbsnmp should probably work.
Warner Losh
2018-06-27 20:13:55 UTC
Permalink
Post by Simon J. Gerraty
Post by Warner Losh
Post by Hartmut Brandt
In libbsnmp a header file is created during the build process, which
obviously ends up in the object tree. Now I need to include this file
when building the daemon and modules from usr.sbin. I have the feeling
that doing
CFLAGS += -I../../../lib/libbsnmp/libbsnmp
use ${SRCTOP}/lib/... here
I think he said it's a generated header.
Looks like share/mk/src.sys.obj.mk now sets OBJTOP
or at least OBJROOT even for non-meta-mode build.
So -I${OBJTOP}/lib/libbsnmp/libbsnmp should probably work.
Oh, you're right. I missed that detail.

Warner

Continue reading on narkive:
Loading...