Skip to content

Commit

Permalink
Added make uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Aug 15, 2014
1 parent 2fed722 commit 06f2a3b
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Default target
all:: build tools doc
all:: build tools doc manifest

# vars utils
UTIL_SPACE := $() #
Expand All @@ -15,6 +15,9 @@ GZ = /bin/gzip --best
TAR = /bin/tar
PYTHON = /usr/bin/python
MAKE ?= /usr/bin/make
TOUCH = /bin/touch
FIND = /bin/find
SED = /bin/sed

# Source directories
SD_ROOT = $(subst $(UTIL_SPACE),\$(UTIL_SPACE),$(shell pwd))
Expand Down Expand Up @@ -55,17 +58,30 @@ doc: FORCE
tools: FORCE
@cd $(SD_TOOLS); $(MAKE)

manifest: build doc tools
$(TOUCH) $(SD_BUILD)/$(ID_DATA)/doc/$(EXENAME)/MANIFEST;
$(TOUCH) $(SD_BUILD)/$(ID_SYSCONF)/postinstall/$(EXENAME).sh.done;
cd $(SD_BUILD); $(FIND) -P . -type f -or -type l | $(SED) -r "s/^\\./$$(echo $(ID_ROOT) | $(SED) s/\\//\\\\\\//g)/" > $(SD_BUILD)/$(ID_DATA)/doc/$(EXENAME)/MANIFEST;

test: build FORCE
@cd $(SD_TEST); $(MAKE)

installtest: install FORCE
@cd $(SD_TEST); $(MAKE) $@

install: FORCE
install: install-manifest FORCE
@cd $(SD_SRC); $(MAKE) $@
@cd $(SD_DOC); $(MAKE) $@
@cd $(SD_TOOLS); $(MAKE) $@

install-manifest: manifest
$(CP) $(SD_BUILD)/$(ID_DATA)/doc/$(EXENAME)/MANIFEST $(ID_ROOT)/$(ID_DATA)/doc/$(EXENAME)/MANIFEST;

uninstall: FORCE
while read path; do\
$(RM) "$$path";\
done < $(ID_ROOT)/$(ID_DATA)/doc/$(EXENAME)/MANIFEST;

$(SD_DIST)/$(EXENAME)-$(VERSION): build doc tools
$(MKDIR) $(SD_DIST)/$(EXENAME)-$(VERSION)
cd $(SD_BUILD); pwd; $(TAR) -jcf $(SD_DIST)/$(EXENAME)-$(VERSION)/$(EXENAME)-$(VERSION).tar.bz2 *
Expand Down

0 comments on commit 06f2a3b

Please sign in to comment.