My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

54 lignes
1.1 KiB

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