-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path0006-patch-common.mk.patch
152 lines (137 loc) · 3.89 KB
/
0006-patch-common.mk.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
From f5c46218aad154e1fb103299df4311da146471a5 Mon Sep 17 00:00:00 2001
From: ap-- <[email protected]>
Date: Tue, 16 May 2017 22:49:32 +0200
Subject: [PATCH 2/4] patch common.mk
---
SeaBreeze/common.mk | 85 ++++++++++++++++++++++++++---------------------------
1 file changed, 41 insertions(+), 44 deletions(-)
diff --git a/SeaBreeze/common.mk b/SeaBreeze/common.mk
index 201f9fa..1e2efcd 100644
--- a/SeaBreeze/common.mk
+++ b/SeaBreeze/common.mk
@@ -9,13 +9,14 @@ CFLAGS_BASE = -I${SEABREEZE}/include \
-Wunused \
-Wmissing-include-dirs \
-Werror \
- -g \
-O0 \
-fpic \
-fno-stack-protector \
-shared
-
+# Select debug builds and architecture
+SB_DEBUG ?= 0
+SB_ARCH ?= 64
export UNAME = $(shell uname)
@@ -37,11 +38,26 @@ ifeq ($(UNAME), Darwin)
-Wunused \
-Wmissing-include-dirs \
-Werror \
- -g \
-O0 \
-fpic \
-fno-stack-protector
+ EXTRA_FLAGS =
+ ifeq ($(SB_DEBUG), 1)
+ EXTRA_FLAGS += -g -DOOI_DEBUG
+ endif
+ ifneq (,$(filter $(SB_ARCH),32 fat)) # if 32 or fat
+ EXTRA_FLAGS += -arch i386
+ else ifneq (,$(filter $(SB_ARCH),64 fat)) # if 64 or fat
+ EXTRA_FLAGS += -arch x86_64
+ endif
+
+ # osx install name
+ ifdef install_name
+ LFLAGS_LIB += -install_name $(install_name)
+ endif
+
+
# Cygwin-32 configuration
else ifeq ($(findstring CYGWIN, $(UNAME)), CYGWIN)
# caller can override this, but this is the current Ocean Optics default
@@ -53,20 +69,19 @@ else ifeq ($(findstring CYGWIN, $(UNAME)), CYGWIN)
-Wall \
-Wunused \
-Werror \
- -ggdb3 \
-shared
-# MinGW-32 configuration
-else ifeq ($(findstring MINGW, $(UNAME)), MINGW)
- SUFFIX = dll
- LIBBASENAME = libseabreeze
- LFLAGS_APP += -L/local/lib \
- -lusb0 \
- -lstdc++ \
- -lm
- LFLAGS_LIB += -L/local/lib \
- -lusb0 \
- -shared
+ EXTRA_FLAGS =
+ ifeq ($(SB_DEBUG), 1)
+ EXTRA_FLAGS += "/p:Configuration=Debug"
+ else
+ EXTRA_FLAGS += "/p:Configuration=Release"
+ endif
+ ifeq ($(SB_ARCH), 32)
+ EXTRA_FLAGS += "/p:Platform=Win32"
+ else
+ EXTRA_FLAGS += "/p:Platform=x64"
+ endif
# Linux configuration
else
@@ -79,40 +94,21 @@ else
LFLAGS_LIB += -L/usr/lib \
-shared \
-lusb
-endif
+
+ EXTRA_FLAGS =
+ ifeq ($(SB_DEBUG), 1)
+ EXTRA_FLAGS += "-g -DOOI_DEBUG"
+ endif
+ ifeq ($(SB_ARCH), 32)
+ EXTRA_FLAGS += "-m32"
+ endif
-# enable Logger
-ifndef logger
- logger = 1
-endif
-ifeq ($(logger),1)
- CFLAGS_BASE += -DOOI_DEBUG
endif
-# osx install name
-ifdef install_name
- LFLAGS_LIB += -install_name $(install_name)
-endif
# these are for the .o files making up libseabreeze
-CPPFLAGS = $(CFLAGS_BASE)
-CFLAGS = $(CFLAGS_BASE) -std=gnu99
-
-# allow for a 32 bit build
-ifdef wordwidth
-ifeq ($(wordwidth),32)
- CPPFLAGS += -arch i386
- CFLAGS += -arch i386
- LFLAGS_APP += -arch i386
- LFLAGS_LIB += -arch i386
-endif
-ifeq ($(wordwidth),fat)
- CPPFLAGS += -arch i386 -arch x86_64
- CFLAGS += -arch i386 -arch x86_64
- LFLAGS_APP += -arch i386 -arch x86_64
- LFLAGS_LIB += -arch i386 -arch x86_64
-endif
-endif
+CPPFLAGS = $(CFLAGS_BASE) $(EXTRA_FLAGS)
+CFLAGS = $(CFLAGS_BASE) -std=gnu99 $(EXTRA_FLAGS)
export LIBNAME=$(LIBBASENAME).$(SUFFIX)
@@ -127,6 +123,7 @@ DEPS_C := $(patsubst %.c,%.d,$(SRCS_C))
OBJS_C := $(patsubst %.c,%.o,$(SRCS_C))
VISUALSTUDIO_PROJECTS = VisualStudio2005 \
+ VisualStudio2008 \
VisualStudio2010 \
VisualStudio2012 \
VisualStudio2013 \
--
2.11.0 (Apple Git-81)