• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# GNUmakefile for dhd/exe
3# (Basically a copy of wl/exe linux portion.)
4#
5# Copyright (C) 1999-2010, 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 linuxarm_omap 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
66ifeq ($(TARGETENV), linuxarm_omap)
67CFLAGS += -DBGBRD
68endif
69
70vpath %.c $(SRCBASE)/shared
71
72all: $(DHD_EXE)
73
74$(DHD_EXE): $(DHD_OBJS)
75	$(CC) $(LDFLAGS) -o $@ $^
76
77$(TARGETARCH)/%.o: %.c
78	@mkdir -p $(TARGETARCH)
79	$(CC) -c $(CFLAGS) -o $@ $^
80
81clean:
82	@rm -rf $(TARGETARCH)
83	rm -f $(DHD_EXE) *.o
84	rm -rf build
85
86endif # linux
87
88#-----------------------------------------------------------
89# MacOS
90#
91ifeq ($(TARGETENV), macos)
92DHD_EXE := dhd_macos
93BUILD   := xcodebuild
94PROJECT := dhd.xcodeproj
95PROJTGT := dhd
96
97all: $(DHD_EXE)
98
99# Executable is located in build/Debug/dhd
100dhd_macos:
101	$(BUILD) -project $(PROJECT) -target $(PROJTGT) -configuration Debug build
102
103clean:
104	rm -f $(DHD_EXE) *.o
105	rm -rf build
106
107endif # macos
108
109
110.PHONY: all clean
111
112endif # UNAME
113