Skip to content

Commit 97b0aac

Browse files
author
Xiangfu Liu
committedDec 28, 2011
compile-lm32-rtems: 80 rule cleanup
1 parent d4d964f commit 97b0aac

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed
 

‎compile-lm32-rtems/Makefile

+38-35
Original file line numberDiff line numberDiff line change
@@ -50,52 +50,51 @@ DL=$(if $(wildcard ../dl/.),../dl,dl)
5050
RTEMS_PATCHES_DIR=rtems-patches
5151
MM1_PATCHES_DIR=milkymist-one-patches
5252

53-
.PHONY: all clean
53+
.PHONY: all clean
5454

5555
all: .install.gdb.ok .install.gcc.ok
5656

5757
.install.gcc.ok: .compile.gcc.ok
58-
cd b-gcc && make install
58+
(cd b-gcc && make install)
5959
touch $@
6060

6161
.compile.gcc.ok: .install.binutils.ok .patch.ok gcc-$(GCC_CORE_VERSION)/newlib
6262
export PATH=$(RTEMS_PREFIX)/bin:$$PATH
6363
mkdir -p b-gcc
64-
(cd b-gcc/;\
64+
(cd b-gcc/ && \
6565
../gcc-$(GCC_CORE_VERSION)/configure --target=lm32-rtems4.11 \
66-
--with-gnu-as --with-gnu-ld --with-newlib --verbose --enable-threads \
67-
--enable-languages="c" --disable-shared --prefix=$(RTEMS_PREFIX); \
68-
make all; \
69-
make info; \
70-
)
66+
--with-gnu-as --with-gnu-ld --with-newlib --verbose \
67+
--enable-threads --enable-languages="c" --disable-shared \
68+
--prefix=$(RTEMS_PREFIX) && \
69+
make all info)
7170
touch $@
7271

7372
.install.binutils.ok: .compile.binutils.ok
7473
mkdir -p $(RTEMS_PREFIX)
75-
cd b-binutils && make install
74+
(cd b-binutils && make install)
7675
touch $@
7776

7877
.compile.binutils.ok: .patch.ok
7978
mkdir -p b-binutils
80-
(cd b-binutils; \
81-
../binutils-$(BINUTILS_VERSION)/configure --target=lm32-rtems4.11 --prefix=$(RTEMS_PREFIX); \
82-
make all; \
83-
make info; \
84-
)
79+
(cd b-binutils && \
80+
../binutils-$(BINUTILS_VERSION)/configure --target=lm32-rtems4.11 \
81+
--prefix=$(RTEMS_PREFIX) && \
82+
make all info)
8583
touch $@
8684

8785
gcc-$(GCC_CORE_VERSION)/newlib: .unzip.ok
88-
(cd gcc-$(GCC_CORE_VERSION); ln -s ../newlib-$(NEWLIB_VERSION)/newlib;)
86+
(cd gcc-$(GCC_CORE_VERSION) && \
87+
ln -s ../newlib-$(NEWLIB_VERSION)/newlib)
8988

9089
.patch.ok: .unzip.ok $(RTEMS_PATCHES_DIR)/.ok
91-
(cd binutils-$(BINUTILS_VERSION); cat ../$(RTEMS_PATCHES_DIR)/$(BINUTILS_PATCH) | patch -p1)
92-
(cd gcc-$(GCC_CORE_VERSION); \
93-
cat ../$(RTEMS_PATCHES_DIR)/$(GCC_CORE_PATCH) | patch -p1; \
94-
)
95-
(cd newlib-$(NEWLIB_VERSION); cat ../$(RTEMS_PATCHES_DIR)/$(NEWLIB_PATCH) | patch -p1)
96-
(cd gdb-$(GDB_VERSION); \
97-
cat ../$(RTEMS_PATCHES_DIR)/$(GDB_PATCH) | patch -p1; \
98-
)
90+
(cd binutils-$(BINUTILS_VERSION) && \
91+
patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(BINUTILS_PATCH))
92+
(cd gcc-$(GCC_CORE_VERSION) && \
93+
patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(GCC_CORE_PATCH))
94+
(cd newlib-$(NEWLIB_VERSION) && \
95+
patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(NEWLIB_PATCH))
96+
(cd gdb-$(GDB_VERSION) && \
97+
patch -p1 < ../$(RTEMS_PATCHES_DIR)/$(GDB_PATCH))
9998
touch $@
10099

101100
.unzip.ok: $(DL)/$(BINUTILS).ok $(DL)/$(GCC_CORE).ok $(DL)/$(NEWLIB).ok $(DL)/$(GDB).ok $(DL)/$(MPFR).ok $(DL)/$(MPC).ok $(DL)/$(GMP).ok
@@ -106,31 +105,35 @@ gcc-$(GCC_CORE_VERSION)/newlib: .unzip.ok
106105
tar xf $(DL)/$(GMP)
107106
tar xf $(DL)/$(MPC)
108107
tar xf $(DL)/$(MPFR)
109-
rm -rf gcc-$(GCC_CORE_VERSION)/gmp gcc-$(GCC_CORE_VERSION)/mpc gcc-$(GCC_CORE_VERSION)/mpfr
108+
rm -rf gcc-$(GCC_CORE_VERSION)/gmp gcc-$(GCC_CORE_VERSION)/mpc \
109+
gcc-$(GCC_CORE_VERSION)/mpfr
110110
ln -s ../gmp-$(GMP_VERSION) gcc-$(GCC_CORE_VERSION)/gmp
111111
ln -s ../mpc-$(MPC_VERSION) gcc-$(GCC_CORE_VERSION)/mpc
112112
ln -s ../mpfr-$(MPFR_VERSION) gcc-$(GCC_CORE_VERSION)/mpfr
113113
touch $@
114114

115115
.install.gdb.ok: .compile.gdb.ok
116-
cd b-gdb && make install
116+
(cd b-gdb && make install)
117117
touch $@
118118

119119
.compile.gdb.ok: .install.binutils.ok .patch.ok
120120
export PATH=$(RTEMS_PREFIX)/bin:$$PATH
121121
mkdir -p b-gdb
122-
(cd b-gdb/; \
123-
../gdb-$(GDB_VERSION)/configure --target=lm32-rtems4.11 --prefix=$(RTEMS_PREFIX); \
124-
make all; \
125-
)
122+
(cd b-gdb/ && ../gdb-$(GDB_VERSION)/configure --target=lm32-rtems4.11 \
123+
--prefix=$(RTEMS_PREFIX) && \
124+
make all)
126125
touch $@
127126

128127
$(RTEMS_PATCHES_DIR)/.ok:
129128
mkdir -p $(RTEMS_PATCHES_DIR)
130-
$(WGET) $(RTEMS_PATCHES_DIR)/$(BINUTILS_PATCH) $(RTEMS_SOURCES_URL)/$(BINUTILS_PATCH)
131-
$(WGET) $(RTEMS_PATCHES_DIR)/$(GCC_CORE_PATCH) $(RTEMS_SOURCES_URL)/$(GCC_CORE_PATCH)
132-
$(WGET) $(RTEMS_PATCHES_DIR)/$(NEWLIB_PATCH) $(RTEMS_SOURCES_URL)/$(NEWLIB_PATCH)
133-
$(WGET) $(RTEMS_PATCHES_DIR)/$(GDB_PATCH) $(RTEMS_SOURCES_URL)/$(GDB_PATCH)
129+
$(WGET) $(RTEMS_PATCHES_DIR)/$(BINUTILS_PATCH) \
130+
$(RTEMS_SOURCES_URL)/$(BINUTILS_PATCH)
131+
$(WGET) $(RTEMS_PATCHES_DIR)/$(GCC_CORE_PATCH) \
132+
$(RTEMS_SOURCES_URL)/$(GCC_CORE_PATCH)
133+
$(WGET) $(RTEMS_PATCHES_DIR)/$(NEWLIB_PATCH) \
134+
$(RTEMS_SOURCES_URL)/$(NEWLIB_PATCH)
135+
$(WGET) $(RTEMS_PATCHES_DIR)/$(GDB_PATCH) \
136+
$(RTEMS_SOURCES_URL)/$(GDB_PATCH)
134137
touch $@
135138

136139
$(DL)/$(BINUTILS).ok:
@@ -180,5 +183,5 @@ clean:
180183
rm -rf gmp-$(GMP_VERSION)
181184
rm -rf mpc-$(MPC_VERSION)
182185
rm -rf mpfr-$(MPFR_VERSION)
183-
rm -rf .*.ok
184-
rm -rf .ok
186+
rm -f .*.ok
187+
rm -f .ok

0 commit comments

Comments
 (0)
Please sign in to comment.