summaryrefslogtreecommitdiffstats
path: root/meta-openbmc-machines/meta-openpower/common/recipes-bsp/pflash/pflash/0001-Make-links-target-reusable.patch
blob: 9088f2e314d9cdb31a8c1869c6a79bc5643b2e75 (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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
From e42206bf0729782330778e77283af2aca23499dc Mon Sep 17 00:00:00 2001
From: Dinar Valeev <dvaleev@suse.com>
Date: Tue, 29 Mar 2016 14:36:37 +0200
Subject: [PATCH] Make links target reusable

Move symlinking target to external/common/rules.mk, so the rule
could be reused by gard and opal-prd.

Signed-off-by: Dinar Valeev <dvaleev@suse.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 external/common/rules.mk   | 24 ++++++++++++++++++++++++
 external/gard/Makefile     | 19 ++-----------------
 external/opal-prd/Makefile | 25 ++-----------------------
 external/pflash/Makefile   | 24 +-----------------------
 4 files changed, 29 insertions(+), 63 deletions(-)

diff --git a/external/common/rules.mk b/external/common/rules.mk
index ec20593..4a929d6 100644
--- a/external/common/rules.mk
+++ b/external/common/rules.mk
@@ -17,6 +17,30 @@ endif
 endif
 endif
 
+# Use make V=1 for a verbose build.
+ifndef V
+        Q_CC=	@echo '    CC ' $@;
+        Q_LINK=	@echo '  LINK ' $@;
+        Q_LN=   @echo '    LN ' $@;
+        Q_MKDIR=@echo ' MKDIR ' $@;
+endif
+
+
+.PHONY: links
+links: libflash ccan common
+
+libflash:
+	$(Q_LN)ln -sf ../../libflash ./libflash
+
+ccan:
+	$(Q_LN)ln -sf ../../ccan ./ccan
+
+common:
+	$(Q_LN)ln -sf ../common ./common
+
+make_version.sh:
+	$(Q_LN)ln -sf ../../make_version.sh
+
 ARCH_SRC := $(addprefix common/,$(ARCH_FILES))
 ARCH_OBJS := $(addprefix common-,$(ARCH_FILES:.c=.o))
 
diff --git a/external/gard/Makefile b/external/gard/Makefile
index be3d1ba..b54923d 100644
--- a/external/gard/Makefile
+++ b/external/gard/Makefile
@@ -3,22 +3,7 @@ include rules.mk
 GET_ARCH = ../../external/common/get_arch.sh
 include ../../external/common/rules.mk
 
-all: $(EXE)
-
-.PHONY: links
-links: libflash ccan common make_version.sh
-
-libflash:
-	ln -sf ../../libflash .
-
-ccan:
-	ln -sf ../../ccan .
-
-common:
-	ln -sf ../common .
-
-make_version.sh:
-	ln -sf ../../make_version.sh
+all: links arch_links $(EXE)
 
 #Rebuild version.o so that the the version always matches
 #what the test suite will get from ./make_version.sh
@@ -26,7 +11,7 @@ check: version.o all
 	@ln -sf ../../test/test.sh test/test.sh
 	@test/test-gard
 
-$(OBJS): | links arch_links
+links += make_version.sh
 
 .PHONY: VERSION-always
 .version: VERSION-always
diff --git a/external/opal-prd/Makefile b/external/opal-prd/Makefile
index 3f34371..e89f73d 100644
--- a/external/opal-prd/Makefile
+++ b/external/opal-prd/Makefile
@@ -10,19 +10,11 @@ sbindir = $(prefix)/sbin
 datadir = $(prefix)/share
 mandir = $(datadir)/man
 
-all: opal-prd
+all: links arch_links | opal-prd
 
 GET_ARCH = ../../external/common/get_arch.sh
 include ../../external/common/rules.mk
 
-# Use make V=1 for a verbose build.
-ifndef V
-        Q_CC=	@echo '    CC ' $@;
-        Q_LINK=	@echo '  LINK ' $@;
-        Q_LN=   @echo '    LN ' $@;
-        Q_MKDIR=@echo ' MKDIR ' $@;
-endif
-
 LIBFLASH_OBJS = libflash-blocklevel.o libflash-libffs.o \
                 libflash-libflash.o libflash-ecc.o \
                 libflash-file.o
@@ -30,30 +22,17 @@ LIBFLASH_OBJS = libflash-blocklevel.o libflash-libffs.o \
 OBJS = opal-prd.o thunk.o pnor.o i2c.o module.o version.o \
        $(LIBFLASH_OBJS) common-arch_flash.o
 
-LINKS = ccan common libflash $(ARCH_LINKS)
-
 OPAL_PRD_VERSION ?= $(shell ../../make_version.sh opal-prd)
 
 ifdef KERNEL_DIR
-LINKS += asm/opal-prd.h
+links += asm/opal-prd.h
 endif
 
-ccan:
-	$(Q_LN)ln -sfr ../../ccan ./ccan
-
-libflash:
-	$(Q_LN)ln -sfr ../../libflash ./libflash
-
-common:
-	$(Q_LN)ln -sfr ../common ./common
-
 asm/opal-prd.h:
 	$(Q_MKDIR)mkdir -p asm
 	$(Q_LN)ln -sfr $(KERNEL_DIR)/arch/powerpc/include/uapi/asm/opal-prd.h \
 			asm/opal-prd.h
 
-$(OBJS): | $(LINKS)
-
 %.o: %.c
 	$(Q_CC)$(COMPILE.c) $< -o $@
 
diff --git a/external/pflash/Makefile b/external/pflash/Makefile
index 9d7c183..bc371a3 100644
--- a/external/pflash/Makefile
+++ b/external/pflash/Makefile
@@ -1,30 +1,8 @@
-# Use make V=1 for a verbose build.
-ifndef V
-        Q_CC=	@echo '    CC ' $@;
-        Q_LD=	@echo '    LD ' $@;
-        Q_LN=   @echo '    LN ' $@;
-        Q_MKDIR=@echo ' MKDIR ' $@;
-endif
-
 include rules.mk
 GET_ARCH = ../../external/common/get_arch.sh
 include ../../external/common/rules.mk
 
-all: $(EXE)
-
-.PHONY: links
-links: libflash ccan common
-
-libflash:
-	$(Q_LN)ln -sf ../../libflash .
-
-ccan:
-	$(Q_LN)ln -sf ../../ccan .
-
-common:
-	$(Q_LN)ln -sf ../common .
-
-$(OBJS): | links arch_links
+all: links arch_links $(EXE)
 
 .PHONY: VERSION-always
 .version: VERSION-always
-- 
1.8.3.1

OpenPOWER on IntegriCloud