From 471cc01e747e3ff7ddc424fc7ff56b405654a2ae Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Sat, 6 Jun 2015 20:18:12 -0500 Subject: [PATCH 1/4] Support DESTDIR and PREFIX variables --- makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index fc4d69d..1025a30 100644 --- a/makefile +++ b/makefile @@ -1,3 +1,6 @@ +DESTDIR= +PREFIX=/usr/local + dylibbundler: g++ -c -I./src ./src/Settings.cpp -o ./Settings.o g++ -c -I./src ./src/DylibBundler.cpp -o ./DylibBundler.o @@ -11,5 +14,5 @@ clean: rm -f ./dylibbundler install: dylibbundler - cp ./dylibbundler /usr/local/bin/dylibbundler - chmod 775 /usr/local/bin/dylibbundler \ No newline at end of file + cp ./dylibbundler $(DESTDIR)$(PREFIX)/bin/dylibbundler + chmod 775 $(DESTDIR)$(PREFIX)/bin/dylibbundler From 613a86af89b83bba3ade709adaff942cc42f4d37 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Sat, 6 Jun 2015 20:18:45 -0500 Subject: [PATCH 2/4] Add an "all" makefile target --- makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefile b/makefile index 1025a30..f03a189 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,8 @@ DESTDIR= PREFIX=/usr/local +all: dylibbundler + dylibbundler: g++ -c -I./src ./src/Settings.cpp -o ./Settings.o g++ -c -I./src ./src/DylibBundler.cpp -o ./DylibBundler.o From 559a4335710f552233d6ce2cb605884e178466dc Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Sat, 6 Jun 2015 20:19:16 -0500 Subject: [PATCH 3/4] Declare non-file makefile targets as .PHONY --- makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefile b/makefile index f03a189..7df3e8d 100644 --- a/makefile +++ b/makefile @@ -18,3 +18,5 @@ clean: install: dylibbundler cp ./dylibbundler $(DESTDIR)$(PREFIX)/bin/dylibbundler chmod 775 $(DESTDIR)$(PREFIX)/bin/dylibbundler + +.PHONY: all clean install From ad6ac2a84d4f72e45a1adf985f97ec0f4aad9ed2 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Sat, 6 Jun 2015 20:23:00 -0500 Subject: [PATCH 4/4] Support CXX makefile variable --- makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 7df3e8d..9cec9f5 100644 --- a/makefile +++ b/makefile @@ -4,12 +4,12 @@ PREFIX=/usr/local all: dylibbundler dylibbundler: - g++ -c -I./src ./src/Settings.cpp -o ./Settings.o - g++ -c -I./src ./src/DylibBundler.cpp -o ./DylibBundler.o - g++ -c -I./src ./src/Dependency.cpp -o ./Dependency.o - g++ -c -I./src ./src/main.cpp -o ./main.o - g++ -c -I./src ./src/Utils.cpp -o ./Utils.o - g++ -o ./dylibbundler ./Settings.o ./DylibBundler.o ./Dependency.o ./main.o ./Utils.o + $(CXX) -c -I./src ./src/Settings.cpp -o ./Settings.o + $(CXX) -c -I./src ./src/DylibBundler.cpp -o ./DylibBundler.o + $(CXX) -c -I./src ./src/Dependency.cpp -o ./Dependency.o + $(CXX) -c -I./src ./src/main.cpp -o ./main.o + $(CXX) -c -I./src ./src/Utils.cpp -o ./Utils.o + $(CXX) -o ./dylibbundler ./Settings.o ./DylibBundler.o ./Dependency.o ./main.o ./Utils.o clean: rm -f *.o