mirror of
https://github.com/wg/wrk
synced 2025-02-09 11:32:52 +08:00
generate version from git describe
This commit is contained in:
parent
bc6f6797c4
commit
040db59768
8
Makefile
8
Makefile
@ -20,9 +20,10 @@ endif
|
||||
SRC := wrk.c net.c ssl.c aprintf.c stats.c script.c units.c \
|
||||
ae.c zmalloc.c http_parser.c
|
||||
BIN := wrk
|
||||
VER ?= $(shell git describe --tags --always --dirty)
|
||||
|
||||
ODIR := obj
|
||||
OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC)) $(ODIR)/bytecode.o
|
||||
OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC)) $(ODIR)/bytecode.o $(ODIR)/version.o
|
||||
LIBS := -lluajit-5.1 $(LIBS)
|
||||
|
||||
DEPS :=
|
||||
@ -61,6 +62,9 @@ $(ODIR)/bytecode.o: src/wrk.lua
|
||||
@echo LUAJIT $<
|
||||
@$(SHELL) -c 'PATH=obj/bin:$(PATH) luajit -b $(CURDIR)/$< $(CURDIR)/$@'
|
||||
|
||||
$(ODIR)/version.o:
|
||||
@echo 'const char *VERSION="$(VER)";' | $(CC) -xc -c -o $@ -
|
||||
|
||||
$(ODIR)/%.o : %.c
|
||||
@echo CC $<
|
||||
@$(CC) $(CFLAGS) -c -o $@ $<
|
||||
@ -94,6 +98,8 @@ endif
|
||||
# ------------
|
||||
|
||||
.PHONY: all clean
|
||||
.PHONY: $(ODIR)/version.o
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .lua
|
||||
|
||||
|
@ -16,13 +16,14 @@
|
||||
#include "ae.h"
|
||||
#include "http_parser.h"
|
||||
|
||||
#define VERSION "4.0.0"
|
||||
#define RECVBUF 8192
|
||||
|
||||
#define MAX_THREAD_RATE_S 10000000
|
||||
#define SOCKET_TIMEOUT_MS 2000
|
||||
#define RECORD_INTERVAL_MS 100
|
||||
|
||||
extern const char *VERSION;
|
||||
|
||||
typedef struct {
|
||||
pthread_t thread;
|
||||
aeEventLoop *loop;
|
||||
|
Loading…
Reference in New Issue
Block a user