diff --git a/Makefile b/Makefile index 90a20a9..337b5ee 100644 --- a/Makefile +++ b/Makefile @@ -25,18 +25,24 @@ include common.mk ## Compilation ## -all: \ - c \ - owlps-positioner - -c: \ +C_TARGETS := \ libowlps \ libowlps-client \ libowlps-resultreader \ owlps-client \ - owlps-listener \ owlps-aggregator \ owlps-udp-to-http +ifeq "$(OS)" "Linux" + C_TARGETS += owlps-listener +endif + +ALL_TARGETS := $(C_TARGETS) +ifneq "$(OS)" "OpenBSD" + ALL_TARGETS += owlps-positioner +endif + +all: $(ALL_TARGETS) +c: $(C_TARGETS) libowlps: @$(MAKE) -C $@ $(ARG) diff --git a/common.mk b/common.mk index 5a6a127..e71e3c1 100644 --- a/common.mk +++ b/common.mk @@ -91,6 +91,9 @@ CFLAGS := CXXFLAGS := LDFLAGS := +# OS detection +OS := $(shell uname) + ## OpenWrt specifics ## # # To compile for OpenWrt, the OPENWRT_VERSION variable must be set. @@ -121,6 +124,8 @@ ifndef OPENWRT_TARGET OPENWRT_TARGET := atheros endif ifdef OPENWRT_VERSION + OS := Linux + TOOLCHAIN_PREFIX := $(OPENWRT_ROOT)/$(OPENWRT_TARGET)/$(OPENWRT_VERSION) STAGING_DIR := $(TOOLCHAIN_PREFIX)/staging_dir TOOLCHAIN1 := $(TOOLCHAIN_PREFIX)/toolchain_gcc_uClibc @@ -160,7 +165,6 @@ CFLAGS += -D DEBUG #STRIPFLAGS += -Wl,-s # OS specific flags -OS := $(shell uname) ifeq "$(OS)" "DragonFly" CFLAGS += -I/usr/pkg/include LDFLAGS += -L/usr/pkg/lib