patch-Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. $OpenBSD: patch-Makefile,v 1.4 2016/04/26 18:06:26 jca Exp $
  2. --- Makefile.orig Mon Dec 8 10:28:02 2003
  3. +++ Makefile Tue Apr 26 15:54:05 2016
  4. @@ -3,13 +3,13 @@
  5. #
  6. # use always:
  7. -DEFINES :=
  8. -LIBS := -lm
  9. -INCLUDES :=
  10. +DEFINES := -DHAVE_GETLINE
  11. +LIBS := -lm -L!!LOCALBASE!!/lib
  12. +INCLUDES := -I!!LOCALBASE!!/include -I!!LOCALBASE!!/include/netpbm
  13. ### enable ppm support ###
  14. DEFINES += -D_HAVE_LIB_PPM_
  15. -LIBS += -lppm
  16. +LIBS += -lnetpbm
  17. ### enable PNG support ###
  18. DEFINES += -D_HAVE_PNG_
  19. @@ -19,11 +19,10 @@ LIBS += -lpng
  20. DEFINES += -D_HAVE_ZLIB_
  21. LIBS += -lz
  22. -CC = gcc
  23. WARN = -Wall -Wstrict-prototypes
  24. -COPT = -g -O2
  25. +COPT = -g -O2
  26. -CFLAGS = $(COPT) $(WARN) $(DEFINES) $(INCLUDES)
  27. +CFLAGS += $(WARN) $(DEFINES) $(INCLUDES)
  28. # list of all files that are part of the package
  29. PACKAGE_FILES = Makefile \
  30. @@ -50,14 +49,20 @@ RELEASE=4
  31. # Main targets
  32. TARGETS = subtitle2pgm srttool subtitle2vobsub vobsub2pgm
  33. +DOCS = README* gocrfilter_* pgm2txt
  34. all: $(TARGETS)
  35. +install: all
  36. + $(BSD_INSTALL_PROGRAM) $(TARGETS) $(PREFIX)/bin
  37. + $(BSD_INSTALL_DATA_DIR) $(PREFIX)/share/doc/$(PACKAGE)
  38. + $(BSD_INSTALL_DATA) $(DOCS) $(PREFIX)/share/doc/$(PACKAGE)
  39. +
  40. # Generic Rules
  41. %.o:%.c
  42. @echo Compiling $<
  43. - @$(CC) -c $(CFLAGS) $<
  44. + $(CC) -c $(CFLAGS) $<
  45. # Dependencies
  46. subtitle2pgm.o: subtitle2pgm.c spudec.h subtitle2pgm.h
  47. @@ -70,19 +75,19 @@ vobsub2pgm.o: vobsub2pgm.c vobsub.h spudec.h
  48. # Target
  49. subtitle2pgm: subtitle2pgm.o spudec.o
  50. @echo "Linking $@"
  51. - @$(CC) $(LIBS) $^ -o $@
  52. + $(CC) $(LIBS) $^ -o $@
  53. subtitle2vobsub: subtitle2vobsub.o vobsub.o
  54. @echo "Linking $@"
  55. - @$(CC) $(LIBS) $^ -o $@
  56. + $(CC) $(LIBS) $^ -o $@
  57. srttool: srttool.o
  58. @echo "Linking $@"
  59. - @$(CC) $(LIBS) -g $^ -o $@
  60. + $(CC) $(LIBS) -g $^ -o $@
  61. vobsub2pgm: vobsub2pgm.o vobsub.o spudec.o
  62. @echo "Linking $@"
  63. - @$(CC) $(LIBS) -g $^ -o $@
  64. + $(CC) $(LIBS) -g $^ -o $@
  65. .PHONY: clean dist rpm
  66. clean: