Skip to content

Commit

Permalink
Only build sysctl, vmstat, and related libraries on FreeBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkelsey committed Sep 25, 2014
1 parent 0fb47d6 commit 3e18a0e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
7 changes: 6 additions & 1 deletion bin/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
TOPDIR?=${CURDIR}/..
include ${TOPDIR}/cflags.mk

SUBDIRS=echo echo++ passive sysctl tproxy vmstat
SUBDIRS=echo echo++ passive tproxy
ifeq (${HOST_OS},FreeBSD)
SUBDIRS+=sysctl vmstat
endif

config:
for d in $(SUBDIRS); do ( cd $$d; $(MAKE) config ) ; done
Expand Down
11 changes: 9 additions & 2 deletions bin/passive/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ PROG=passive

SRCS=passive.c

UINET_LIBS=uinet uinetnv
UINET_LIBS=uinet
ifeq (${HOST_OS},FreeBSD)
UINET_LIBES+=uinetnv
endif


CFLAGS= -I${TOPDIR}/lib/libev -I${TOPDIR}/lib/libnv
CFLAGS= -I${TOPDIR}/lib/libev
ifeq (${HOST_OS},FreeBSD)
CFLAGS+= -I${TOPDIR}/lib/libnv
endif
LDADD= -L${UINET_DESTDIR}/lib/ ${TOPDIR}/lib/libev/.libs/libev.a -lm -lpcap

ifndef NO_EXTRACT
Expand Down
2 changes: 2 additions & 0 deletions cflags.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
HOST_OS:=$(shell uname -s)

DEBUG_FLAGS ?= -O -gdwarf-2

UINET_DESTDIR ?= /usr/local/
Expand Down
8 changes: 5 additions & 3 deletions lib/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

SUBDIRS=libuinet libev libuinetnv libuinet_memstat libhttp_parser

TOPDIR?=${CURDIR}/..
include ${TOPDIR}/cflags.mk

SUBDIRS=libuinet libev libhttp_parser
ifeq (${HOST_OS},FreeBSD)
SUBDIRS+=libuinetnv libuinet_memstat
endif

default: all

config:
Expand Down
1 change: 0 additions & 1 deletion mk/kern.pre.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
include ${TOPDIR}/mk/compiler.mk

MACHINE_CPUARCH:= $(shell uname -m)
HOST_OS:=$(shell uname -s)

# Convert Mac OS X name to FreeBSD one.
ifeq (${MACHINE_CPUARCH},x86_64)
Expand Down

0 comments on commit 3e18a0e

Please sign in to comment.