19
19
# IN THE SOFTWARE.
20
20
21
21
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
22
+ HELPER ?=
23
+ BINEXT ?=
22
24
ifeq (darwin,$(PLATFORM ) )
23
25
SONAME ?= libhttp_parser.2.5.0.dylib
24
26
SOEXT ?= dylib
27
+ else ifeq (wine,$(PLATFORM))
28
+ CC = winegcc
29
+ BINEXT = .exe.so
30
+ HELPER = wine
25
31
else
26
32
SONAME ?= libhttp_parser.so.2.5.0
27
33
SOEXT ?= so
28
34
endif
35
+
29
36
CC? =gcc
30
37
AR? =ar
31
38
@@ -58,8 +65,8 @@ LDFLAGS_LIB += -Wl,-soname=$(SONAME)
58
65
endif
59
66
60
67
test : test_g test_fast
61
- ./test_g
62
- ./test_fast
68
+ $( HELPER ) ./test_g$( BINEXT )
69
+ $( HELPER ) ./test_fast$( BINEXT )
63
70
64
71
test_g : http_parser_g.o test_g.o
65
72
$(CC ) $(CFLAGS_DEBUG ) $(LDFLAGS ) http_parser_g.o test_g.o -o $@
@@ -86,7 +93,7 @@ http_parser.o: http_parser.c http_parser.h Makefile
86
93
$(CC ) $(CPPFLAGS_FAST ) $(CFLAGS_FAST ) -c http_parser.c
87
94
88
95
test-run-timed : test_fast
89
- while(true) do time ./test_fast > /dev/null; done
96
+ while(true) do time $( HELPER ) ./test_fast$( BINEXT ) > /dev/null; done
90
97
91
98
test-valgrind : test_g
92
99
valgrind ./test_g
@@ -107,10 +114,10 @@ url_parser_g: http_parser_g.o contrib/url_parser.c
107
114
$(CC ) $(CPPFLAGS_DEBUG ) $(CFLAGS_DEBUG ) $^ -o $@
108
115
109
116
parsertrace : http_parser.o contrib/parsertrace.c
110
- $(CC ) $(CPPFLAGS_FAST ) $(CFLAGS_FAST ) $^ -o parsertrace
117
+ $(CC ) $(CPPFLAGS_FAST ) $(CFLAGS_FAST ) $^ -o parsertrace$( BINEXT )
111
118
112
119
parsertrace_g : http_parser_g.o contrib/parsertrace.c
113
- $(CC ) $(CPPFLAGS_DEBUG ) $(CFLAGS_DEBUG ) $^ -o parsertrace_g
120
+ $(CC ) $(CPPFLAGS_DEBUG ) $(CFLAGS_DEBUG ) $^ -o parsertrace_g$( BINEXT )
114
121
115
122
tags : http_parser.c http_parser.h test.c
116
123
ctags $^
@@ -133,7 +140,8 @@ uninstall:
133
140
clean :
134
141
rm -f * .o * .a tags test test_fast test_g \
135
142
http_parser.tar libhttp_parser.so.* \
136
- url_parser url_parser_g parsertrace parsertrace_g
143
+ url_parser url_parser_g parsertrace parsertrace_g \
144
+ * .exe * .exe.so
137
145
138
146
contrib/url_parser.c : http_parser.h
139
147
contrib/parsertrace.c : http_parser.h
0 commit comments