mirror of
https://github.com/google/brotli.git
synced 2024-11-28 14:11:07 +00:00
e9b278ac6e
* doxygenize and update API documentation * fix spelling * add "fuzz" corpus for java decoder to improve coverage * use upper-case-snake names for dictionary constant definitions * use `LDFLAGS` in conventional `Makefile`
43 lines
1002 B
Makefile
43 lines
1002 B
Makefile
OS := $(shell uname)
|
|
LIBSOURCES = $(wildcard common/*.c) $(wildcard dec/*.c) $(wildcard enc/*.c)
|
|
SOURCES = $(LIBSOURCES) tools/bro.c
|
|
BINDIR = bin
|
|
OBJDIR = $(BINDIR)/obj
|
|
LIBOBJECTS = $(addprefix $(OBJDIR)/, $(LIBSOURCES:.c=.o))
|
|
OBJECTS = $(addprefix $(OBJDIR)/, $(SOURCES:.c=.o))
|
|
LIB_A = libbrotli.a
|
|
EXECUTABLE = bro
|
|
DIRS = $(OBJDIR)/common $(OBJDIR)/dec $(OBJDIR)/enc \
|
|
$(OBJDIR)/tools $(BINDIR)/tmp
|
|
CFLAGS += -O2
|
|
ifeq ($(os), Darwin)
|
|
CPPFLAGS += -DOS_MACOSX
|
|
endif
|
|
|
|
all: test
|
|
@:
|
|
|
|
.PHONY: all clean test
|
|
|
|
$(DIRS):
|
|
mkdir -p $@
|
|
|
|
$(EXECUTABLE): $(OBJECTS)
|
|
$(CC) $(LDFLAGS) $(OBJECTS) -lm -o $(BINDIR)/$(EXECUTABLE)
|
|
|
|
lib: $(LIBOBJECTS)
|
|
rm -f $(LIB_A)
|
|
ar -crs $(LIB_A) $(LIBOBJECTS)
|
|
|
|
test: $(EXECUTABLE)
|
|
tests/compatibility_test.sh
|
|
tests/roundtrip_test.sh
|
|
|
|
clean:
|
|
rm -rf $(BINDIR) $(LIB_A)
|
|
|
|
.SECONDEXPANSION:
|
|
$(OBJECTS): $$(patsubst %.o,%.c,$$(patsubst $$(OBJDIR)/%,%,$$@)) | $(DIRS)
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -Iinclude \
|
|
-c $(patsubst %.o,%.c,$(patsubst $(OBJDIR)/%,%,$@)) -o $@
|