A Simple X Image Viewer
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

90 wiersze
2.0 KiB

  1. VERSION = git-20171016
  2. srcdir = .
  3. PREFIX = /usr/local
  4. MANPREFIX = $(PREFIX)/share/man
  5. CC ?= cc
  6. CFLAGS += -std=c99 -Wall -pedantic
  7. CPPFLAGS += -I/usr/include/freetype2
  8. DEPFLAGS = -MMD -MP
  9. LDFLAGS +=
  10. # autoreload backend: inotify/nop
  11. AUTORELOAD = inotify
  12. # enable features requiring giflib (-lgif)
  13. HAVE_GIFLIB = 1
  14. # enable features requiring libexif (-lexif)
  15. HAVE_LIBEXIF = 1
  16. REQ_CPPFLAGS = -I. -D_XOPEN_SOURCE=700 -DVERSION=\"$(VERSION)\" \
  17. -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF)
  18. ALL_CPPFLAGS = $(REQ_CPPFLAGS) $(CPPFLAGS)
  19. LIB_EXIF_0 =
  20. LIB_EXIF_1 = -lexif
  21. LIB_GIF_0 =
  22. LIB_GIF_1 = -lgif
  23. LDLIBS = -lImlib2 -lX11 -lXft \
  24. $(LIB_EXIF_$(HAVE_LIBEXIF)) $(LIB_GIF_$(HAVE_GIFLIB))
  25. SRCS = autoreload_$(AUTORELOAD).c commands.c image.c main.c options.c \
  26. thumbs.c util.c window.c
  27. OBJS = $(SRCS:.c=.o)
  28. DEPS = $(SRCS:.c=.d)
  29. all: sxiv
  30. .PHONY: all clean install uninstall
  31. .SUFFIXES:
  32. .SUFFIXES: .c .o
  33. $(V).SILENT:
  34. sxiv: $(OBJS)
  35. @echo "LINK $@"
  36. $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
  37. $(OBJS): $(srcdir)/Makefile $(srcdir)/sxiv.h config.h
  38. .c.o:
  39. @echo "CC $@"
  40. $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
  41. %.o: $(srcdir)/%.c
  42. @echo "CC $@"
  43. $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $(srcdir)/$(@:.o=.c)
  44. config.h:
  45. @echo "GEN $@"
  46. cp $(srcdir)/config.def.h $@
  47. clean:
  48. rm -f $(OBJS) $(DEPS) sxiv
  49. install: all
  50. @echo "INSTALL bin/sxiv"
  51. mkdir -p $(DESTDIR)$(PREFIX)/bin
  52. cp sxiv $(DESTDIR)$(PREFIX)/bin/
  53. chmod 755 $(DESTDIR)$(PREFIX)/bin/sxiv
  54. @echo "INSTALL sxiv.1"
  55. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  56. sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1 \
  57. >$(DESTDIR)$(MANPREFIX)/man1/sxiv.1
  58. chmod 644 $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
  59. @echo "INSTALL share/sxiv/"
  60. mkdir -p $(DESTDIR)$(PREFIX)/share/sxiv/exec
  61. cp exec/* $(DESTDIR)$(PREFIX)/share/sxiv/exec/
  62. chmod 755 $(DESTDIR)$(PREFIX)/share/sxiv/exec/*
  63. uninstall:
  64. @echo "REMOVE bin/sxiv"
  65. rm -f $(DESTDIR)$(PREFIX)/bin/sxiv
  66. @echo "REMOVE sxiv.1"
  67. rm -f $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
  68. @echo "REMOVE share/sxiv/"
  69. rm -rf $(DESTDIR)$(PREFIX)/share/sxiv