Add installation target to makefile
This commit is contained in:
parent
0d4a741186
commit
e0fc6e5740
14
makefile
14
makefile
@ -1,5 +1,7 @@
|
||||
TARGET = $(notdir $(CURDIR))
|
||||
|
||||
INSTALL = /usr/local/bin
|
||||
|
||||
SRCEXT = .c
|
||||
INCEXT = .h
|
||||
OBJEXT = .o
|
||||
@ -21,12 +23,18 @@ OBJTREE = $(foreach D,$(SRCTREE),$(shell echo $(D) | sed 's/$(SRCDIR)/$(OBJDIR)/
|
||||
OBJSTMP = $(foreach F,$(SRCS),$(shell echo $(F) | sed -e 's/$(SRCDIR)/$(OBJDIR)/'))
|
||||
OBJS = $(foreach O,$(OBJSTMP),$(shell echo $(O) | sed -e 's/\$(SRCEXT)/\$(OBJEXT)/'))
|
||||
|
||||
all: $(TARGET)
|
||||
build: $(TARGET)
|
||||
@echo Done.
|
||||
|
||||
run: $(TARGET)
|
||||
run: build
|
||||
@./$(TARGET)
|
||||
|
||||
install: build
|
||||
@cp $(TARGET) $(INSTALL)
|
||||
|
||||
uninstall:
|
||||
@rm -f $(INSTALL)/$(TARGET)
|
||||
|
||||
clean:
|
||||
@rm -r $(TARGET) $(OBJS) $(OBJDIR) 2>/dev/null || true
|
||||
|
||||
@ -39,4 +47,4 @@ $(OBJS): $(OBJDIR)/%$(OBJEXT) : $(SRCDIR)/%$(SRCEXT) | $(OBJDIR)
|
||||
$(OBJDIR):
|
||||
@mkdir -p $(OBJDIR) $(OBJTREE)
|
||||
|
||||
.PHONY: all run clean
|
||||
.PHONY: build run install clean
|
||||
|
Loading…
Reference in New Issue
Block a user