My build of nnn with minor changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

49 lines
967 B

  1. VERSION = 1.0
  2. PREFIX = /usr/local
  3. MANPREFIX = $(PREFIX)/share/man
  4. CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter
  5. LDLIBS = -lreadline
  6. ifeq ($(shell uname), Darwin)
  7. LDLIBS += -lncurses
  8. else
  9. LDLIBS += -lncursesw
  10. endif
  11. DISTFILES = nnn.c config.def.h nnn.1 Makefile README.md LICENSE
  12. LOCALCONFIG = config.h
  13. SRC = nnn.c
  14. BIN = nnn
  15. all: $(BIN)
  16. $(LOCALCONFIG): config.def.h
  17. cp config.def.h $@
  18. $(SRC): $(LOCALCONFIG)
  19. $(BIN): $(SRC)
  20. $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
  21. strip $@
  22. install: all
  23. mkdir -p $(DESTDIR)$(PREFIX)/bin
  24. cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
  25. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  26. cp -f $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1
  27. uninstall:
  28. rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
  29. rm -f $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1
  30. dist:
  31. mkdir -p nnn-$(VERSION)
  32. cp $(DISTFILES) nnn-$(VERSION)
  33. tar -cf nnn-$(VERSION).tar nnn-$(VERSION)
  34. gzip nnn-$(VERSION).tar
  35. rm -rf nnn-$(VERSION)
  36. clean:
  37. rm -f $(BIN) nnn-$(VERSION).tar.gz