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.

114 lines
1.8 KiB

  1. --- a/Makefile
  2. +++ b/Makefile
  3. @@ -1,17 +1,16 @@
  4. -PREFIX=/usr/local
  5. -BINDIR=$(DESTDIR)$(PREFIX)/bin
  6. -CFLAGS=-Wall -Werror\
  7. - -Wformat=2\
  8. - -g\
  9. -
  10. -LDFLAGS=
  11. -OS=$(shell uname|tr A-Z a-z)
  12. -INSTALL=install
  13. -
  14. -VERS=$(shell ./vers.sh)
  15. -TARG=beanstalkd
  16. -MOFILE=main.o
  17. -OFILES=\
  18. +PREFIX ?= /usr/local
  19. +BINDIR = $(DESTDIR)$(PREFIX)/bin
  20. +CFLAGS += -Wall -Werror -Wformat=2 -g
  21. +LDFLAGS +=
  22. +LDLIBS ?=
  23. +
  24. +OS ?= $(shell uname | tr 'A-Z' 'a-z')
  25. +INSTALL ?= install
  26. +
  27. +VERS = $(shell ./vers.sh)
  28. +TARG = beanstalkd
  29. +MOFILE = main.o
  30. +OFILES = \
  31. $(OS).o\
  32. conn.o\
  33. file.o\
  34. @@ -29,52 +28,44 @@ OFILES=\
  35. vers.o\
  36. walg.o\
  37. -TOFILES=\
  38. +TOFILES = \
  39. testheap.o\
  40. testjobs.o\
  41. testserv.o\
  42. testutil.o\
  43. -HFILES=\
  44. +HFILES = \
  45. dat.h\
  46. sd-daemon.h\
  47. ifeq ($(OS),linux)
  48. -
  49. -LDLIBS=\
  50. - -lrt\
  51. -
  52. + LDLIBS += -lrt
  53. endif
  54. -CLEANFILES=\
  55. +CLEANFILES = \
  56. vers.c\
  57. -.PHONY: all
  58. all: $(TARG)
  59. $(TARG): $(OFILES) $(MOFILE)
  60. $(LINK.o) -o $@ $^ $(LDLIBS)
  61. -.PHONY: install
  62. install: $(BINDIR)/$(TARG)
  63. $(BINDIR)/%: %
  64. $(INSTALL) -d $(dir $@)
  65. $(INSTALL) $< $@
  66. -CLEANFILES:=$(CLEANFILES) $(TARG)
  67. +CLEANFILES := $(CLEANFILES) $(TARG)
  68. $(OFILES) $(MOFILE): $(HFILES)
  69. -.PHONY: clean
  70. clean:
  71. rm -f *.o $(CLEANFILES)
  72. -.PHONY: check
  73. check: ct/_ctcheck
  74. ct/_ctcheck
  75. -.PHONY: bench
  76. bench: ct/_ctcheck
  77. ct/_ctcheck -b
  78. @@ -88,11 +79,8 @@ ct/ct.o ct/_ctcheck.o: ct/ct.h ct/intern
  79. $(TOFILES): $(HFILES) ct/ct.h
  80. -CLEANFILES:=$(CLEANFILES) ct/_* ct/*.o
  81. +CLEANFILES += ct/_* ct/*.o
  82. -ifneq ($(shell ./verc.sh),$(shell cat vers.c 2>/dev/null))
  83. -.PHONY: vers.c
  84. -endif
  85. vers.c:
  86. ./verc.sh >vers.c
  87. @@ -100,3 +88,9 @@ doc/beanstalkd.1 doc/beanstalkd.1.html:
  88. ronn $<
  89. freebsd.o: darwin.c
  90. +
  91. +.PHONY: all install clean check bench
  92. +
  93. +ifneq ($(shell ./verc.sh),$(shell cat vers.c 2>/dev/null))
  94. +.PHONY: vers.c
  95. +endif