aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 16 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index a61038c..2ecc212 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,28 @@
-PREFIX=$(PREFIX)
+CXX=g++
+CXXFLAGS=-std=c++11 -Wall -O2
+SRC=*.cpp
+TARGET=me
+PREFIX=$$PREFIX
all:
- g++ -std=c++11 *.cpp -o me -Wall -O2
+ $(CXX) $(SRC) $(CXXFLAGS) -o $(TARGET)
+ echo "Done."
-clean: me
- rm 'me'
+clean: $(TARGET)
+ rm $(TARGET)
test:
- echo $$PREFIX
+ echo $(PREFIX)
-install: me
+install: $(TARGET)
if [ -z "$$PREFIX" ] ; then \
echo "No PREFIX set. Aborting install."; \
else \
echo "Installing in $$PREFIX/bin/..."; \
cp me "$$PREFIX"/bin/me; \
- echo "Done."; \
+ if [ $$? -eq 0 ] ; then \
+ echo "Installation successful."; \
+ else \
+ echo "Installation failed."; \
+ fi \
fi