Skip to content

Commit 502f7c0

Browse files
committed
Invoke sub-makes via ${MAKE}
- This fixes the case where make is not named `make', e.g. `gmake' - This handles jobs correctly
1 parent 1180e60 commit 502f7c0

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@ DEBUG=${ALL_DEBUG}
1212
export EXTRALINK
1313

1414
all:
15-
OPTZ="${O2}" make default
15+
OPTZ="${O2}" ${MAKE} default
1616

1717
.PHONY: default
1818
default:
19-
make deps
20-
make lib
21-
make src
19+
${MAKE} deps
20+
${MAKE} lib
21+
${MAKE} src
2222

2323
.PHONY: debug
2424
debug:
25-
OPTZ="${O0}" DEBUG="${ALL_DEBUG}" make default
25+
OPTZ="${O0}" DEBUG="${ALL_DEBUG}" ${MAKE} default
2626

2727
.PHONY: deps
2828
deps:
29-
cd deps && make -j 5
29+
cd deps && ${MAKE}
3030

3131
.PHONY: lib
3232
lib:
33-
cd lib && make -j 5
33+
cd lib && ${MAKE}
3434

3535
.PHONY: src
3636
src:
37-
cd src && make
37+
cd src && ${MAKE}
3838

3939
.PHONY: clean
4040
clean:
41-
cd lib && make clean
42-
cd src && make clean
41+
cd lib && ${MAKE} clean
42+
cd src && ${MAKE} clean
4343

4444
packages: centos7 ubuntu12 ubuntu14
4545
.PHONY: packages
@@ -76,7 +76,7 @@ binaries/proxysql_1.0.1-ubuntu14_amd64.deb:
7676
docker create --name ubuntu14_build renecannao/proxysql:build-ubuntu14 bash -c "while : ; do sleep 10 ; done"
7777
docker start ubuntu14_build
7878
docker exec ubuntu14_build bash -c "cd /opt; git clone https://github.com/sysown/proxysql.git proxysql"
79-
docker exec ubuntu14_build bash -c "cd /opt/proxysql; make clean && make -j"
79+
docker exec ubuntu14_build bash -c "cd /opt/proxysql; ${MAKE} clean && ${MAKE} -j"
8080
docker cp docker/images/proxysql/ubuntu-14.04-build/proxysql.ctl ubuntu14_build:/opt/proxysql/
8181
docker exec ubuntu14_build bash -c "cd /opt/proxysql; cp src/proxysql . ; equivs-build proxysql.ctl"
8282
docker cp ubuntu14_build:/opt/proxysql/proxysql_1.0.1_amd64.deb ./binaries/proxysql_1.0.1-ubuntu14_amd64.deb
@@ -86,9 +86,9 @@ binaries/proxysql_1.0.1-ubuntu14_amd64.deb:
8686

8787
.PHONY: cleanall
8888
cleanall:
89-
cd deps && make cleanall
90-
cd lib && make clean
91-
cd src && make clean
89+
cd deps && ${MAKE} cleanall
90+
cd lib && ${MAKE} clean
91+
cd src && ${MAKE} clean
9292
rm binaries/*deb || true
9393
rm binaries/*rpm || true
9494

deps/Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ libdaemon/libdaemon/libdaemon/.libs/libdaemon.a:
88
cd libdaemon && rm -rf libdaemon-0.14
99
cd libdaemon && tar -zxf libdaemon-0.14.tar.gz
1010
cd libdaemon/libdaemon && ./configure
11-
cd libdaemon/libdaemon && make
11+
cd libdaemon/libdaemon && ${MAKE}
1212

1313
libdaemon: libdaemon/libdaemon/libdaemon/.libs/libdaemon.a
1414

1515
libevent/libevent/.libs/libevent.a:
1616
cd libevent && rm -rf libevent-2.0.22-stable
1717
cd libevent && tar -zxf libevent-2.0.22-stable.tar.gz
1818
cd libevent/libevent && ./configure
19-
cd libevent/libevent && make
19+
cd libevent/libevent && ${MAKE}
2020

2121
libevent: libevent/libevent/.libs/libevent.a
2222

2323
libinjection/libinjection.a:
24-
cd libinjection && make
24+
cd libinjection && ${MAKE}
2525

2626
libinjection: libinjection/libinjection.a
2727

@@ -30,7 +30,7 @@ jemalloc/jemalloc/lib/libjemalloc.a:
3030
cd jemalloc && rm -rf jemalloc-3.6.0
3131
cd jemalloc && tar -jxf jemalloc-3.6.0.tar.bz2
3232
cd jemalloc/jemalloc && ./configure --enable-xmalloc
33-
cd jemalloc/jemalloc && make
33+
cd jemalloc/jemalloc && ${MAKE}
3434

3535
jemalloc: jemalloc/jemalloc/lib/libjemalloc.a
3636

@@ -42,7 +42,7 @@ mariadb-client-library/mariadb_client/include/my_config.h:
4242
cd mariadb-client-library/mariadb_client && cmake .
4343
cd mariadb-client-library/mariadb_client && patch libmariadb/libmariadb.c < ../libmariadb.c.patch
4444
cd mariadb-client-library/mariadb_client && patch include/mysql.h < ../mysql.h.patch
45-
cd mariadb-client-library/mariadb_client && make
45+
cd mariadb-client-library/mariadb_client && ${MAKE}
4646
# cd mariadb-client-library/mariadb_client/include && make my_config.h
4747

4848
mariadb_client: mariadb-client-library/mariadb_client/include/my_config.h
@@ -59,7 +59,7 @@ libconfig/libconfig/lib/.libs/libconfig++.a:
5959
cd libconfig && rm -rf libconfig-1.4.9
6060
cd libconfig && tar -zxf libconfig-1.4.9.tar.gz
6161
cd libconfig/libconfig && ./configure
62-
cd libconfig/libconfig && make
62+
cd libconfig/libconfig && ${MAKE}
6363

6464
libconfig: libconfig/libconfig/lib/.libs/libconfig++.a
6565

@@ -69,7 +69,7 @@ re2/re2/obj/libre2.a:
6969
cd re2 && tar -zxf re2-20140304.tgz
7070
cd re2/re2 && sed -i -e 's/-O3 -g /-O3 -fPIC /' Makefile
7171
cd re2 && patch re2/util/mutex.h < mutex.h.patch
72-
cd re2/re2 && make
72+
cd re2/re2 && ${MAKE}
7373

7474
re2: re2/re2/obj/libre2.a
7575

@@ -79,7 +79,7 @@ cleanall:
7979
cd mariadb-client-library && rm -rf mariadb_client-2.0.0-src
8080
cd libconfig && rm -rf libconfig-1.4.9
8181
cd re2 && rm -rf re2
82-
cd libinjection && make clean
82+
cd libinjection && ${MAKE} clean
8383
cd libevent && rm -rf libevent-2.0.22-stable
8484
# cd sqlite3 && rm -rf sqlite-amalgamation-3080403
8585
.PHONY: cleanall

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $(ODIR):
8181
mkdir $(ODIR)
8282

8383
$(LIBPROXYSQLAR):
84-
cd $(LDIR) && make
84+
cd $(LDIR) && ${MAKE}
8585

8686
default: $(EXECUTABLE)
8787

0 commit comments

Comments
 (0)