make (un)install

This commit is contained in:
Connor Lane Smith 2011-06-08 11:37:00 +01:00
parent b5ff71655d
commit 1e4a4e460d
2 changed files with 19 additions and 1 deletions

View File

@ -59,6 +59,20 @@ util.a: $(LIB)
@echo AR -r $@ @echo AR -r $@
@$(AR) -r -c $@ $(LIB) @$(AR) -r -c $@ $(LIB)
install:
@echo installing executables to $(DESTDIR)$(PREFIX)/bin
@mkdir -p $(DESTDIR)$(PREFIX)/bin
@cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
@cd $(DESTDIR)$(PREFIX)/bin && chmod 755 $(BIN)
@echo installing manual pages to $(DESTDIR)$(MANPREFIX)/man1
@mkdir -p $(DESTDIR)$(MANPREFIX)/man1
@cp -f $(MAN) $(DESTDIR)$(MANPREFIX)/man1
@cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN)
uninstall:
@cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN)
@cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN)
dist: clean dist: clean
@echo creating dist tarball @echo creating dist tarball
@mkdir -p sbase-$(VERSION) @mkdir -p sbase-$(VERSION)

View File

@ -1,8 +1,12 @@
# sbase version # sbase version
VERSION = 0.0 VERSION = 0.0
# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
#CC = gcc #CC = gcc
CC = musl-gcc #CC = musl-gcc
LD = $(CC) LD = $(CC)
CPPFLAGS = -D_POSIX_C_SOURCE=200112L CPPFLAGS = -D_POSIX_C_SOURCE=200112L
CFLAGS = -Os -ansi -Wall -pedantic $(CPPFLAGS) CFLAGS = -Os -ansi -Wall -pedantic $(CPPFLAGS)