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.

Makefile 1.3 KiB

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