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.
 
 
 
 
 
 

58 lignes
1.2 KiB

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