mirror of
https://github.com/wg/wrk
synced 2026-06-10 00:55:51 +08:00
Compare commits
8 Commits
@@ -0,0 +1,17 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.builder }}
|
||||
strategy:
|
||||
matrix:
|
||||
builder: [macos-latest, ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: build
|
||||
run: make
|
||||
@@ -1,5 +1,5 @@
|
||||
CFLAGS += -std=c99 -Wall -O2 -D_REENTRANT
|
||||
LIBS := -lpthread -lm -lssl -lcrypto
|
||||
LIBS := -lm -lssl -lcrypto -lpthread
|
||||
|
||||
TARGET := $(shell uname -s | tr '[A-Z]' '[a-z]' 2>/dev/null || echo unknown)
|
||||
|
||||
@@ -7,7 +7,7 @@ ifeq ($(TARGET), sunos)
|
||||
CFLAGS += -D_PTHREADS -D_POSIX_C_SOURCE=200112L
|
||||
LIBS += -lsocket
|
||||
else ifeq ($(TARGET), darwin)
|
||||
LDFLAGS += -pagezero_size 10000 -image_base 100000000
|
||||
export MACOSX_DEPLOYMENT_TARGET = $(shell sw_vers -productVersion)
|
||||
else ifeq ($(TARGET), linux)
|
||||
CFLAGS += -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE
|
||||
LIBS += -ldl
|
||||
@@ -59,9 +59,9 @@ $(OBJ): config.h Makefile $(DEPS) | $(ODIR)
|
||||
$(ODIR):
|
||||
@mkdir -p $@
|
||||
|
||||
$(ODIR)/bytecode.o: src/wrk.lua
|
||||
$(ODIR)/bytecode.c: src/wrk.lua $(DEPS)
|
||||
@echo LUAJIT $<
|
||||
@$(SHELL) -c 'PATH=obj/bin:$(PATH) luajit -b $(CURDIR)/$< $(CURDIR)/$@'
|
||||
@$(SHELL) -c 'PATH="obj/bin:$(PATH)" luajit -b "$(CURDIR)/$<" "$(CURDIR)/$@"'
|
||||
|
||||
$(ODIR)/version.o:
|
||||
@echo 'const char *VERSION="$(VER)";' | $(CC) -xc -c -o $@ -
|
||||
@@ -72,13 +72,14 @@ $(ODIR)/%.o : %.c
|
||||
|
||||
# Dependencies
|
||||
|
||||
LUAJIT := $(notdir $(patsubst %.tar.gz,%,$(wildcard deps/LuaJIT*.tar.gz)))
|
||||
LUAJIT := $(notdir $(patsubst %.zip,%,$(wildcard deps/LuaJIT*.zip)))
|
||||
OPENSSL := $(notdir $(patsubst %.tar.gz,%,$(wildcard deps/openssl*.tar.gz)))
|
||||
|
||||
OPENSSL_OPTS = no-shared no-psk no-srp no-dtls no-idea --prefix=$(abspath $(ODIR))
|
||||
|
||||
$(ODIR)/$(LUAJIT): deps/$(LUAJIT).tar.gz | $(ODIR)
|
||||
@tar -C $(ODIR) -xf $<
|
||||
$(ODIR)/$(LUAJIT): deps/$(LUAJIT).zip | $(ODIR)
|
||||
echo $(LUAJIT)
|
||||
@unzip -nd $(ODIR) $<
|
||||
|
||||
$(ODIR)/$(OPENSSL): deps/$(OPENSSL).tar.gz | $(ODIR)
|
||||
@tar -C $(ODIR) -xf $<
|
||||
@@ -90,11 +91,7 @@ $(ODIR)/lib/libluajit-5.1.a: $(ODIR)/$(LUAJIT)
|
||||
|
||||
$(ODIR)/lib/libssl.a: $(ODIR)/$(OPENSSL)
|
||||
@echo Building OpenSSL...
|
||||
ifeq ($(TARGET), darwin)
|
||||
@$(SHELL) -c "cd $< && ./Configure $(OPENSSL_OPTS) darwin64-x86_64-cc"
|
||||
else
|
||||
@$(SHELL) -c "cd $< && ./config $(OPENSSL_OPTS)"
|
||||
endif
|
||||
@$(MAKE) -C $< depend
|
||||
@$(MAKE) -C $<
|
||||
@$(MAKE) -C $< install_sw
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user