forked from google/brotli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (28 loc) · 738 Bytes
/
Makefile
File metadata and controls
35 lines (28 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
OS := $(shell uname)
SOURCES = $(wildcard common/*.c) $(wildcard dec/*.c) $(wildcard enc/*.c) \
tools/bro.c
BINDIR = bin
OBJDIR = $(BINDIR)/obj
OBJECTS = $(addprefix $(OBJDIR)/, $(SOURCES:.c=.o))
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 $@
$(OBJECTS): $(DIRS)
$(CC) $(CFLAGS) $(CPPFLAGS) \
-c $(patsubst %.o,%.c,$(patsubst $(OBJDIR)/%,%,$@)) -o $@
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) -lm -o $(BINDIR)/$(EXECUTABLE)
test: $(EXECUTABLE)
tests/compatibility_test.sh
tests/roundtrip_test.sh
clean:
rm -rf $(BINDIR)