-
Notifications
You must be signed in to change notification settings - Fork 69
/
Makefile
43 lines (32 loc) · 1.12 KB
/
Makefile
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
36
37
38
39
40
41
42
43
CC = gcc
CFLAGS = -Wall -std=gnu99 -O2 -ggdb3 -march=native -fPIC -Wno-format-zero-length -Wno-unused-parameter
LDFLAGS =
CPPFLAGS = -UNDEBUG -UG_DISABLE_ASSERT `getconf LFS_CFLAGS` `pkg-config --cflags glib-2.0` -D_GNU_SOURCE
LDLIBS = `pkg-config --libs glib-2.0`
EXTRA =
.PHONY: clean check
all: check halfempty
check:
@echo -n "Checking for glib-2.0..."
@pkg-config glib-2.0 || { echo "not found (install libglib2.0-dev or glib2-devel)"; false; }
@echo ok
ifeq ($(shell uname),Darwin)
CPPFLAGS += -DSPLICE_GENERIC -DSENDFILE_GENERIC
EXTRA = sendfile_generic.o splice_generic.o
endif
# splice() does not appear to work reliably on Windows
ifeq ($(findstring Microsoft,$(shell uname -r)), Microsoft)
EXTRA = splice_generic.o sendfile_generic.o
endif
ifeq ($(shell uname),NetBSD)
EXTRA = sendfile_generic.o splice_generic.o
endif
halfempty: proc.o bisect.o util.o zero.o tree.o flags.o halfempty.o limits.o $(EXTRA)
util.o: monitor.h util.c
test: all
make -C test
%.h: %.tpl
hexdump -ve '"" 1/1 "%#02x" ","' $< > $@
clean:
rm -f *.o *.dot *.out halfempty monitor.h
make -C test clean