1# 2# GNUmakefile for dhd/exe 3# (Basically a copy of wl/exe linux portion.) 4# 5# Copyright (C) 1999-2009, Broadcom Corporation 6# 7# Unless you and Broadcom execute a separate written software license 8# agreement governing use of this software, this software is licensed to you 9# under the terms of the GNU General Public License version 2 (the "GPL"), 10# available at http://www.broadcom.com/licenses/GPLv2.php, with the 11# following added to such license: 12# 13# As a special exception, the copyright holders of this software give you 14# permission to link this software with independent modules, and to copy and 15# distribute the resulting executable under terms of your choice, provided that 16# you also meet, for each linked independent module, the terms and conditions of 17# the license of that module. An independent module is a module which is not 18# derived from this software. The special exception does not apply to any 19# modifications of the software. 20# 21# Notwithstanding the above, under no circumstances may you combine this 22# software in any way with any other Broadcom software provided under a license 23# other than the GPL, without Broadcom's express prior written consent. 24# 25# $Id: GNUmakefile,v 1.9.24.4.2.4 2009/03/04 03:53:29 Exp $ 26 27SRCBASE = ../.. 28 29UNAME = $(shell uname) 30 31#----------------------------------------------------------- 32# Windows build 33# 1) windows, don't include Makerules due to all: conflict 34ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 35 36SRCFILE = 37include ../../GNUmakefile.inc 38 39else # UNAME 40 41# 2) not windows, need to include first to pick up TARGETENV dependent vars 42include $(SRCBASE)/Makerules 43 44 45# Always include pktgen commands in the application 46CFLAGS += -DSDTEST 47CFLAGS += -DBCMSPI 48 49#----------------------------------------------------------- 50# Linux build 51# 52ifneq ($(findstring $(TARGETENV), "linux linuxmips linuxmips_be linuxarm linuxarm_le android"),) 53 54# $(TARGETARCH) is set based on TARGETENV in src/Makerules.* files 55DHD_OBJS := dhdu.o dhdu_linux.o bcmutils.o miniopt.o 56DHD_EXE := dhd 57 58ifneq ($(findstring x86,$(TARGETARCH)),x86) 59 DHD_EXE := $(DHD_EXE)$(TARGETARCH) 60 DHD_OBJS := $(DHD_OBJS:%.o=$(TARGETARCH)/%.o) 61endif 62 63# extra warnings 64CFLAGS += -Wextra $(CUSTOM_FLAGS) 65 66vpath %.c $(SRCBASE)/shared 67 68all: $(DHD_EXE) 69 70$(DHD_EXE): $(DHD_OBJS) 71 $(CC) $(LDFLAGS) -o $@ $^ 72 73$(TARGETARCH)/%.o: %.c 74 @mkdir -p $(TARGETARCH) 75 $(CC) -c $(CFLAGS) -o $@ $^ 76 77clean: 78 @rm -rf $(TARGETARCH) 79 rm -f $(DHD_EXE) *.o 80 rm -rf build 81 82endif # linux 83 84#----------------------------------------------------------- 85# MacOS 86# 87ifeq ($(TARGETENV), macos) 88DHD_EXE := dhd_macos 89BUILD := xcodebuild 90PROJECT := dhd.xcodeproj 91PROJTGT := dhd 92 93all: $(DHD_EXE) 94 95# Executable is located in build/Debug/dhd 96dhd_macos: 97 $(BUILD) -project $(PROJECT) -target $(PROJTGT) -configuration Debug build 98 99clean: 100 rm -f $(DHD_EXE) *.o 101 rm -rf build 102 103endif # macos 104 105 106.PHONY: all clean 107 108endif # UNAME 109