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.7 KiB

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