wrk-3.1.1-makefile.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. diff --git i/Makefile w/Makefile
  2. index d956c6b..48be677 100644
  3. --- i/Makefile
  4. +++ w/Makefile
  5. @@ -1,4 +1,4 @@
  6. -CFLAGS := -std=c99 -Wall -O2 -D_REENTRANT
  7. +CFLAGS += -std=c99 -Wall -D_REENTRANT
  8. LIBS := -lpthread -lm -lcrypto -lssl
  9. TARGET := $(shell uname -s | tr '[A-Z]' '[a-z]' 2>/dev/null || echo unknown)
  10. @@ -23,38 +23,31 @@ BIN := wrk
  11. ODIR := obj
  12. OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC)) $(ODIR)/bytecode.o
  13. -LDIR = deps/luajit/src
  14. -LIBS := -lluajit $(LIBS)
  15. -CFLAGS += -I$(LDIR)
  16. -LDFLAGS += -L$(LDIR)
  17. +LIBS := $(shell pkg-config --libs luajit) $(LIBS)
  18. +CFLAGS += $(shell pkg-config --cflags luajit)
  19. all: $(BIN)
  20. clean:
  21. $(RM) $(BIN) obj/*
  22. - @$(MAKE) -C deps/luajit clean
  23. $(BIN): $(OBJ)
  24. @echo LINK $(BIN)
  25. - @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
  26. + @$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
  27. -$(OBJ): config.h Makefile $(LDIR)/libluajit.a | $(ODIR)
  28. +$(OBJ): config.h Makefile | $(ODIR)
  29. $(ODIR):
  30. @mkdir -p $@
  31. $(ODIR)/bytecode.o: src/wrk.lua
  32. @echo LUAJIT $<
  33. - @$(SHELL) -c 'cd $(LDIR) && ./luajit -b $(CURDIR)/$< $(CURDIR)/$@'
  34. + @$(SHELL) -c 'luajit -b $(CURDIR)/$< $(CURDIR)/$@'
  35. $(ODIR)/%.o : %.c
  36. @echo CC $<
  37. @$(CC) $(CFLAGS) -c -o $@ $<
  38. -$(LDIR)/libluajit.a:
  39. - @echo Building LuaJIT...
  40. - @$(MAKE) -C $(LDIR) BUILDMODE=static
  41. -
  42. .PHONY: all clean
  43. .SUFFIXES:
  44. .SUFFIXES: .c .o .lua