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.

8 年之前
10 年之前
10 年之前
7 年之前
10 年之前
7 年之前
7 年之前
10 年之前
10 年之前
10 年之前
10 年之前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. VERSION = 0.6
  2. PREFIX = /usr/local
  3. MANPREFIX = $(PREFIX)/man
  4. #CPPFLAGS = -DDEBUG
  5. #CFLAGS = -g
  6. CFLAGS = -O3 -march=native -fno-asynchronous-unwind-tables -fdata-sections \
  7. -ffunction-sections -Wl,--gc-sections
  8. LDLIBS = -lcurses
  9. DISTFILES = nnn.c strlcat.c strlcpy.c util.h config.def.h \
  10. nnn.1 Makefile README.md LICENSE
  11. OBJ = nnn.o strlcat.o strlcpy.o
  12. BIN = nnn
  13. all: $(BIN)
  14. $(BIN): $(OBJ)
  15. $(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)
  16. strip -S --strip-unneeded --remove-section=.note.gnu.gold-version \
  17. --remove-section=.comment --remove-section=.note \
  18. --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag $(BIN)
  19. nnn.o: util.h config.h
  20. strlcat.o: util.h
  21. strlcpy.o: util.h
  22. config.h: config.def.h
  23. cp config.def.h $@
  24. install: all
  25. mkdir -p $(DESTDIR)$(PREFIX)/bin
  26. cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
  27. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  28. cp -f $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1
  29. uninstall:
  30. rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
  31. rm -f $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1
  32. dist:
  33. mkdir -p nnn-$(VERSION)
  34. cp $(DISTFILES) nnn-$(VERSION)
  35. tar -cf nnn-$(VERSION).tar nnn-$(VERSION)
  36. gzip nnn-$(VERSION).tar
  37. rm -rf nnn-$(VERSION)
  38. clean:
  39. rm -f config.h $(BIN) $(OBJ) nnn-$(VERSION).tar.gz