Add install/uninstall to Makefile
This commit is contained in:
16
Makefile
16
Makefile
@@ -1,13 +1,13 @@
|
||||
CXX ?= c++
|
||||
CPPFLAGS ?= -O2
|
||||
CPPFLAGS += -Wall \
|
||||
CXXFLAGS ?= -O2
|
||||
CXXFLAGS += -Wall \
|
||||
-Wextra \
|
||||
-pipe \
|
||||
-Wmissing-declarations \
|
||||
-pedantic \
|
||||
-fstack-protector-strong \
|
||||
|
||||
LDFLAGS=-lncursesw -Wl,-z,relro,-z,now
|
||||
LDFLAGS = -lncursesw -Wl,-z,relro,-z,now
|
||||
|
||||
SOURCES = main.cpp \
|
||||
chess.cpp \
|
||||
@@ -20,6 +20,7 @@ SOURCES = main.cpp \
|
||||
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
EXECUTABLE = chess
|
||||
INSTALLDIR := $(DESTDIR)/usr/bin
|
||||
|
||||
all: $(SOURCES) $(EXECUTABLE)
|
||||
|
||||
@@ -29,10 +30,17 @@ $(EXECUTABLE): $(OBJECTS)
|
||||
|
||||
.cpp.o:
|
||||
@echo ' CC $@'
|
||||
@$(CXX) $(CPPFLAGS) -c $< -o $@
|
||||
@$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJECTS) $(EXECUTABLE)
|
||||
|
||||
distclean:
|
||||
rm -rf $(OBJECTS)
|
||||
|
||||
install:
|
||||
install -m755 -D $(EXECUTABLE) "$(INSTALLDIR)/$(EXECUTABLE)"
|
||||
|
||||
uninstall:
|
||||
rm -f "$(INSTALLDIR)/$(EXECUTABLE)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user