A Simple X Image Viewer
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.
 
 
 
 
 
 

54 lines
1.2 KiB

  1. VERSION = 1.3
  2. PREFIX = /usr/local
  3. MANPREFIX = $(PREFIX)/share/man
  4. CC = gcc
  5. CFLAGS = -std=c99 -Wall -pedantic -O2
  6. CPPFLAGS = -I$(PREFIX)/include -D_XOPEN_SOURCE=500 -DHAVE_LIBEXIF -DHAVE_GIFLIB
  7. LDFLAGS = -L$(PREFIX)/lib
  8. LIBS = -lX11 -lImlib2 -lexif -lgif
  9. SRC = commands.c image.c main.c options.c thumbs.c util.c window.c
  10. OBJ = $(SRC:.c=.o)
  11. all: sxiv
  12. $(OBJ): Makefile config.h
  13. depend: .depend
  14. .depend: $(SRC)
  15. rm -f ./.depend
  16. $(CC) $(CFLAGS) -MM $^ >./.depend
  17. include .depend
  18. .c.o:
  19. $(CC) $(CFLAGS) $(CPPFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
  20. config.h:
  21. cp config.def.h $@
  22. sxiv: $(OBJ)
  23. $(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
  24. clean:
  25. rm -f $(OBJ) sxiv
  26. install: all
  27. mkdir -p $(DESTDIR)$(PREFIX)/bin
  28. cp sxiv $(DESTDIR)$(PREFIX)/bin/
  29. chmod 755 $(DESTDIR)$(PREFIX)/bin/sxiv
  30. mkdir -p $(DESTDIR)$(MANPREFIX)/man1
  31. sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1 > $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
  32. chmod 644 $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
  33. mkdir -p $(DESTDIR)$(PREFIX)/share/sxiv/exec
  34. cp exec/* $(DESTDIR)$(PREFIX)/share/sxiv/exec/
  35. chmod 755 $(DESTDIR)$(PREFIX)/share/sxiv/exec/*
  36. uninstall:
  37. rm -f $(DESTDIR)$(PREFIX)/bin/sxiv
  38. rm -f $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
  39. rm -rf $(DESTDIR)$(PREFIX)/share/sxiv