diff options
| author | 2017-04-13 08:12:10 +0530 | |
|---|---|---|
| committer | 2017-04-13 08:12:10 +0530 | |
| commit | 372a3a0c80bef525314428396f37692a5c6a5fb9 (patch) | |
| tree | ee13958debf0c1b80b37ed6c9a6b0186e83d6937 /Makefile.generic | |
| parent | 9702abdd81774854540368600ea324af4829941d (diff) | |
| download | nnn-372a3a0c80bef525314428396f37692a5c6a5fb9.tar.gz | |
Add Makefile.generic, update docs
Diffstat (limited to 'Makefile.generic')
| -rw-r--r-- | Makefile.generic | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile.generic b/Makefile.generic new file mode 100644 index 0000000..80d4f16 --- /dev/null +++ b/Makefile.generic @@ -0,0 +1,43 @@ +VERSION = 0.6 + +PREFIX = /usr/local +MANPREFIX = $(PREFIX)/man + +CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter +LDLIBS = -lcurses + +DISTFILES = nnn.c config.def.h nnn.1 Makefile README.md LICENSE +LOCALCONFIG = config.h +SRC = nnn.c +BIN = nnn + +all: $(BIN) + +$(LOCALCONFIG): config.def.h + cp config.def.h $@ + +$(SRC): $(LOCALCONFIG) + +$(BIN): $(SRC) + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) + strip $@ + +install: all + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + cp -f $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1 + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN) + rm -f $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1 + +dist: + mkdir -p nnn-$(VERSION) + cp $(DISTFILES) nnn-$(VERSION) + tar -cf nnn-$(VERSION).tar nnn-$(VERSION) + gzip nnn-$(VERSION).tar + rm -rf nnn-$(VERSION) + +clean: + rm -f $(BIN) nnn-$(VERSION).tar.gz |