1
0
mirror of https://github.com/wg/wrk synced 2025-01-08 23:32:54 +08:00
wrk/Makefile

39 lines
640 B
Makefile
Raw Normal View History

CFLAGS := -std=c99 -Wall -O2 -D_REENTRANT
2013-01-12 15:21:02 +08:00
LIBS := -lpthread -lm
TARGET := $(shell uname -s | tr [A-Z] [a-z] 2>/dev/null || echo unknown)
ifeq ($(TARGET), sunos)
CFLAGS += -D_PTHREADS
LIBS += -lsocket
2013-01-12 15:21:02 +08:00
endif
2012-03-18 14:16:09 +08:00
SRC := wrk.c aprintf.c stats.c units.c ae.c zmalloc.c http_parser.c tinymt64.c
BIN := wrk
ODIR := obj
OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC))
all: $(BIN)
clean:
$(RM) $(BIN) obj/*
$(BIN): $(OBJ)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
$(OBJ): config.h Makefile | $(ODIR)
$(ODIR):
@mkdir $@
$(ODIR)/%.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
.PHONY: all clean
.SUFFIXES:
.SUFFIXES: .c .o
vpath %.c src
vpath %.h src