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.

Makefile 1.2 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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) -o $@ $^ $(LDFLAGS) $(LDLIBS)
  23. strip $@
  24. debug: $(SRC)
  25. $(CC) -DDEBUGMODE -g $(CFLAGS) -o nnndbg $^ $(LDFLAGS) $(LDLIBS)
  26. install: all
  27. mkdir -p $(DESTDIR)$(PREFIX)/bin
  28. cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
  29. cp -f $(PLAYER) $(DESTDIR)$(PREFIX)/bin
  30. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  31. cp -f $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1
  32. uninstall:
  33. rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
  34. rm -f $(DESTDIR)$(PREFIX)/bin/$(PLAYER)
  35. rm -f $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1
  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 -rf nnn-$(VERSION)
  42. clean:
  43. rm -f $(BIN) nnn-$(VERSION).tar.gz