summarylogtreecommitdiffstats
path: root/makepkg-cflags.patch
blob: 5ed2a1acad10304abaf1389ab8c93509054a3304 (plain)
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
From ee0348722629ecafee9d1db3c0d37d149622521c Mon Sep 17 00:00:00 2001
Message-Id: <ee0348722629ecafee9d1db3c0d37d149622521c.1652042168.git.tommyhebb@gmail.com>
In-Reply-To: <11c8680c8d0ec0e9c834f57efdfd3827453f4c6a.1652042168.git.tommyhebb@gmail.com>
References: <11c8680c8d0ec0e9c834f57efdfd3827453f4c6a.1652042168.git.tommyhebb@gmail.com>
From: Thomas Hebb <tommyhebb@gmail.com>
Date: Sun, 8 May 2022 13:04:07 -0700
Subject: [PATCH 2/2] Don't set our own CFLAGS and LDFLAGS

Instead, use the ones from the environment as much as possible. makepkg
is opinionated about what flags to set, and we want to respect them.
---
 Common.mk                              | 11 +----------
 Library.mk                             | 11 +----------
 USBDM_API_Example/Common.mk            | 11 +----------
 USBDM_Programmer_API_Example/Common.mk | 11 +----------
 4 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/Common.mk b/Common.mk
index aa94a528..18eea2b4 100755
--- a/Common.mk
+++ b/Common.mk
@@ -302,21 +302,12 @@ ifeq ($(UNAME_S),Windows)
 else
    GCC_VISIBILITY_DEFS :=-fvisibility=hidden -fvisibility-inlines-hidden
    THREADS := 
-   CFLAGS := -fPIC
+   CFLAGS += -fPIC
 endif
 
 ifdef DEBUG
-   # Compiler flags
-   CFLAGS += -O0 -g3
-   # Compiler flags (Linking)
-   LDFLAGS = -O0 -g3
    # C Definitions
    DEFS   := -DLOG
-else
-   # Compiler flags
-   CFLAGS += -O3 -g3 
-   # Compiler flags (Linking) - include DEBUG info as can be stripped later
-   LDFLAGS = -O3 -g3 
 endif
 
 ifneq ($(UNAME_S),Windows)
diff --git a/Library.mk b/Library.mk
index 76b8047d..d7fb7393 100644
--- a/Library.mk
+++ b/Library.mk
@@ -286,21 +286,12 @@ ifeq ($(UNAME_S),Windows)
 else
    GCC_VISIBILITY_DEFS :=-fvisibility=hidden -fvisibility-inlines-hidden
    THREADS := 
-   CFLAGS := -fPIC
+   CFLAGS += -fPIC
 endif
 
 ifdef DEBUG
-   # Compiler flags
-   CFLAGS += -O0 -g3
-   # Compiler flags (Linking)
-   LDFLAGS = 
    # C Definitions
    DEFS   := -DLOG
-else
-   # Compiler flags
-   CFLAGS += -O3 -g0 
-   # Compiler flags (Linking)
-   LDFLAGS = -s
 endif
 
 ifneq ($(OS),Windows_NT)
diff --git a/USBDM_API_Example/Common.mk b/USBDM_API_Example/Common.mk
index bc877eab..32f82fc5 100755
--- a/USBDM_API_Example/Common.mk
+++ b/USBDM_API_Example/Common.mk
@@ -303,21 +303,12 @@ ifeq ($(UNAME_S),Windows)
 else
    GCC_VISIBILITY_DEFS :=-fvisibility=hidden -fvisibility-inlines-hidden
    THREADS := 
-   CFLAGS := -fPIC
+   CFLAGS += -fPIC
 endif
 
 ifdef DEBUG
-   # Compiler flags
-   CFLAGS += -O0 -g3
-   # Compiler flags (Linking)
-   LDFLAGS = -O0 -g3
    # C Definitions
    DEFS   := -DLOG
-else
-   # Compiler flags
-   CFLAGS += -O3 -g3 
-   # Compiler flags (Linking) - include DEBUG info as can be stripped later
-   LDFLAGS = -O3 -g3 
 endif
 
 ifneq ($(UNAME_S),Windows)
diff --git a/USBDM_Programmer_API_Example/Common.mk b/USBDM_Programmer_API_Example/Common.mk
index bc877eab..32f82fc5 100755
--- a/USBDM_Programmer_API_Example/Common.mk
+++ b/USBDM_Programmer_API_Example/Common.mk
@@ -303,21 +303,12 @@ ifeq ($(UNAME_S),Windows)
 else
    GCC_VISIBILITY_DEFS :=-fvisibility=hidden -fvisibility-inlines-hidden
    THREADS := 
-   CFLAGS := -fPIC
+   CFLAGS += -fPIC
 endif
 
 ifdef DEBUG
-   # Compiler flags
-   CFLAGS += -O0 -g3
-   # Compiler flags (Linking)
-   LDFLAGS = -O0 -g3
    # C Definitions
    DEFS   := -DLOG
-else
-   # Compiler flags
-   CFLAGS += -O3 -g3 
-   # Compiler flags (Linking) - include DEBUG info as can be stripped later
-   LDFLAGS = -O3 -g3 
 endif
 
 ifneq ($(UNAME_S),Windows)
-- 
2.36.0