Skip to content

Commit e39722d

Browse files
graydonbrson
authored andcommitted
---
yaml --- r: 4442 b: refs/heads/master c: 7da64ae h: refs/heads/master v: v3
1 parent 9a80b6b commit e39722d

File tree

7 files changed

+67
-84
lines changed

7 files changed

+67
-84
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: b2c3fc739c82968dcd629a7e3f3a468e366be976
2+
refs/heads/master: 7da64ae461bdf5c159d1566d66b9561c29f4224e

trunk/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
include config.mk
66
MKFILES := Makefile config.mk $(wildcard $(CFG_SRC_DIR)/mk/*.mk)
7+
MKFILES += $(CFG_SRC_DIR)/src/rt/libuv/Makefile
8+
MKFILES += $(wildcard $(CFG_SRC_DIR)/src/rt/libuv/*.mk)
79

810
ifneq ($(MAKE_RESTARTS),)
911
CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))

trunk/configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ step_msg "making directories"
179179
for i in \
180180
doc \
181181
rt rt/isaac rt/bigint rt/sync rt/test rt/arch/i386 \
182+
rt/libuv rt/libuv/src/ares rt/libuv/src/eio rt/libuv/src/ev \
182183
rustllvm \
183184
dl stage0 stage1 stage2 stage3 \
184185
stage0/lib stage1/lib stage2/lib stage3/lib \
@@ -315,4 +316,8 @@ rm -f config.mk.bak
315316

316317
copy ${CFG_SRC_DIR}Makefile.in ./Makefile
317318

319+
copy ${CFG_SRC_DIR}src/rt/libuv/Makefile rt/libuv/Makefile
320+
copy ${CFG_SRC_DIR}src/rt/libuv/config-unix.mk rt/libuv/config-unix.mk
321+
copy ${CFG_SRC_DIR}src/rt/libuv/config-mingw.mk rt/libuv/config-mingw.mk
322+
318323
step_msg "complete"

trunk/mk/rt.mk

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ RUNTIME_DEF := rt/rustrt$(CFG_DEF_SUFFIX)
6868
RUNTIME_INCS := -I $(S)src/rt/isaac -I $(S)src/rt/uthash \
6969
-I $(S)src/rt/arch/i386 -I $(S)src/rt/libuv/include
7070
RUNTIME_OBJS := $(RUNTIME_CS:.cpp=.o) $(RUNTIME_LL:.ll=.o) $(RUNTIME_S:.s=.o)
71-
RUNTIME_LIBS := $(S)src/rt/libuv/uv.a
71+
RUNTIME_LIBS := rt/libuv/uv.a
7272

7373
rt/%.o: rt/%.cpp $(MKFILES)
7474
@$(call E, compile: $@)
@@ -101,10 +101,12 @@ rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF) $(RU
101101
# FIXME: For some reason libuv's makefiles can't figure out the correct definition
102102
# of CC on the mingw I'm using, so we are explicitly using gcc. Also, we
103103
# have to list environment variables first on windows... mysterious
104-
$(S)src/rt/libuv/uv.a: $(S)src/rt/libuv/LIBUV_REVISION
105-
$(Q)CFLAGS=\"-m32\" LDFLAGS=\"-m32\" CC=gcc $(MAKE) -C $(S)src/rt/libuv
106-
$(Q)mkdir -p rt/libuv
107-
$(Q)cp $(S)src/rt/libuv/uv.a rt/libuv/uv.a
104+
rt/libuv/uv.a: $(wildcard \
105+
$(S)src/rt/libuv/* \
106+
$(S)src/rt/libuv/*/* \
107+
$(S)src/rt/libuv/*/*/* \
108+
$(S)src/rt/libuv/*/*/*/*)
109+
$(Q)CFLAGS=\"-m32\" LDFLAGS=\"-m32\" CC=gcc $(MAKE) -C rt/libuv
108110

109111
# These could go in rt.mk or rustllvm.mk, they're needed for both.
110112

trunk/src/rt/libuv/Makefile

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,30 @@
1818
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1919
# IN THE SOFTWARE.
2020

21+
include ../../config.mk
22+
CFLAGS=-m32
23+
LDFLAGS=-m32
24+
CC=gcc
25+
26+
S:=$(shell cd ../../; cd $(CFG_SRC_DIR)src/rt/libuv; pwd)
27+
28+
ifdef VERBOSE
29+
Q :=
30+
EE =
31+
else
32+
Q := @
33+
EE = echo $(1)
34+
endif
35+
36+
VPATH:=$(S)
37+
2138
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
2239

2340
ifdef MSVC
2441
uname_S := MINGW
2542
endif
2643

27-
CPPFLAGS += -Iinclude
44+
CPPFLAGS += -I$(S)/include
2845

2946
CARES_OBJS =
3047
CARES_OBJS += src/ares/ares__close_sockets.o
@@ -77,37 +94,8 @@ else
7794
include config-unix.mk
7895
endif
7996

80-
TESTS=test/echo-server.c test/test-*.c
81-
BENCHMARKS=test/echo-server.c test/dns-server.c test/benchmark-*.c
82-
83-
all: uv.a test/run-tests test/run-benchmarks
97+
all: uv.a
8498

8599
$(CARES_OBJS): %.o: %.c
86-
$(CC) -o $*.o -c $(CFLAGS) $(CPPFLAGS) $< -DHAVE_CONFIG_H
87-
88-
test/run-tests$(E): test/*.h test/run-tests.c $(RUNNER_SRC) test/runner-unix.c $(TESTS) uv.a
89-
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) $(RUNNER_LINKFLAGS) -o test/run-tests test/run-tests.c \
90-
test/runner.c $(RUNNER_SRC) $(TESTS) uv.a $(RUNNER_LIBS)
91-
92-
test/run-benchmarks$(E): test/*.h test/run-benchmarks.c test/runner.c $(RUNNER_SRC) $(BENCHMARKS) uv.a
93-
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) $(RUNNER_LINKFLAGS) -o test/run-benchmarks test/run-benchmarks.c \
94-
test/runner.c $(RUNNER_SRC) $(BENCHMARKS) uv.a $(RUNNER_LIBS)
95-
96-
test/echo.o: test/echo.c test/echo.h
97-
$(CC) $(CPPFLAGS) $(CFLAGS) -c test/echo.c -o test/echo.o
98-
99-
100-
.PHONY: clean clean-platform distclean distclean-platform test benchmark
101-
102-
103-
test: test/run-tests$(E)
104-
test/run-tests
105-
106-
bench: test/run-benchmarks$(E)
107-
test/run-benchmarks
108-
109-
clean: clean-platform
110-
$(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)
111-
112-
distclean: distclean-platform
113-
$(RM) -f src/*.o *.a test/run-tests$(E) test/run-benchmarks$(E)
100+
@$(call EE, compile: $@)
101+
$(Q)$(CC) -o $*.o -c $(CFLAGS) $(CPPFLAGS) $< -DHAVE_CONFIG_H

trunk/src/rt/libuv/config-mingw.mk

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,33 @@ CC ?= $(PREFIX)gcc
2424
AR ?= $(PREFIX)ar
2525
E=.exe
2626

27-
CFLAGS+=$(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0501 -Isrc/ares/config_win32
27+
CFLAGS+=$(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0501 -I$(S)src/ares/config_win32
2828
LINKFLAGS=-lm
2929

3030
CARES_OBJS += src/ares/windows_port.o
3131

32-
RUNNER_CFLAGS=$(CFLAGS) -D_GNU_SOURCE # Need _GNU_SOURCE for strdup?
33-
RUNNER_LINKFLAGS=$(LINKFLAGS)
34-
RUNNER_LIBS=-lws2_32
35-
RUNNER_SRC=test/runner-win.c
36-
3732
uv.a: src/uv-win.o src/uv-common.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)
38-
$(AR) rcs uv.a src/uv-win.o src/uv-common.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)
33+
@$(call EE, ar: $@)
34+
$(Q)$(AR) rcs uv.a $^
3935

4036
src/uv-win.o: src/uv-win.c include/uv.h include/uv-win.h
41-
$(CC) $(CFLAGS) -c src/uv-win.c -o src/uv-win.o
37+
@$(call EE, compile: $@)
38+
$(Q)$(CC) $(CFLAGS) -c $< -o $@
4239

4340
src/uv-common.o: src/uv-common.c include/uv.h include/uv-win.h
44-
$(CC) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o
41+
@$(call EE, compile: $@)
42+
$(Q)$(CC) $(CFLAGS) -c $< -o $@
4543

4644
EIO_CPPFLAGS += $(CPPFLAGS)
4745
EIO_CPPFLAGS += -DEIO_CONFIG_H=\"$(EIO_CONFIG)\"
4846
EIO_CPPFLAGS += -DEIO_STACKSIZE=65536
4947
EIO_CPPFLAGS += -D_GNU_SOURCE
5048

5149
src/eio/eio.o: src/eio/eio.c
52-
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/eio/eio.c -o src/eio/eio.o
50+
@$(call EE, compile: $@)
51+
$(Q)$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c $< -o $@
5352

5453
src/uv-eio.o: src/uv-eio.c
55-
$(CC) $(CPPFLAGS) -Isrc/eio/ $(CFLAGS) -c src/uv-eio.c -o src/uv-eio.o
56-
57-
clean-platform:
58-
-rm -f src/ares/*.o
59-
-rm -f src/eio/*.o
54+
@$(call EE, compile: $@)
55+
$(Q)$(CC) $(CPPFLAGS) -I$(S)src/eio/ $(CFLAGS) -c $< -o $@
6056

61-
distclean-platform:
62-
-rm -f src/ares/*.o
63-
-rm -f src/eio/*.o

trunk/src/rt/libuv/config-unix.mk

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AR ?= $(PREFIX)ar
2323
E=
2424
CSTDFLAG=--std=c89 -pedantic
2525
CFLAGS+=-g
26-
CPPFLAGS += -Isrc/ev
26+
CPPFLAGS += -I$(S)/src/ev
2727
LINKFLAGS=-lm
2828

2929
CPPFLAGS += -D_LARGEFILE_SOURCE
@@ -32,15 +32,15 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64
3232
ifeq (SunOS,$(uname_S))
3333
EV_CONFIG=config_sunos.h
3434
EIO_CONFIG=config_sunos.h
35-
CPPFLAGS += -Isrc/ares/config_sunos
35+
CPPFLAGS += -I$(S)/src/ares/config_sunos
3636
LINKFLAGS+=-lsocket -lnsl
3737
UV_OS_FILE=uv-sunos.c
3838
endif
3939

4040
ifeq (Darwin,$(uname_S))
4141
EV_CONFIG=config_darwin.h
4242
EIO_CONFIG=config_darwin.h
43-
CPPFLAGS += -Isrc/ares/config_darwin
43+
CPPFLAGS += -I$(S)/src/ares/config_darwin
4444
LINKFLAGS+=-framework CoreServices
4545
UV_OS_FILE=uv-darwin.c
4646
endif
@@ -49,23 +49,23 @@ ifeq (Linux,$(uname_S))
4949
EV_CONFIG=config_linux.h
5050
EIO_CONFIG=config_linux.h
5151
CSTDFLAG += -D_XOPEN_SOURCE=600
52-
CPPFLAGS += -Isrc/ares/config_linux
52+
CPPFLAGS += -I$(S)/src/ares/config_linux
5353
LINKFLAGS+=-lrt
5454
UV_OS_FILE=uv-linux.c
5555
endif
5656

5757
ifeq (FreeBSD,$(uname_S))
5858
EV_CONFIG=config_freebsd.h
5959
EIO_CONFIG=config_freebsd.h
60-
CPPFLAGS += -Isrc/ares/config_freebsd
60+
CPPFLAGS += -I$(S)/src/ares/config_freebsd
6161
LINKFLAGS+=
6262
UV_OS_FILE=uv-freebsd.c
6363
endif
6464

6565
ifneq (,$(findstring CYGWIN,$(uname_S)))
6666
EV_CONFIG=config_cygwin.h
6767
EIO_CONFIG=config_cygwin.h
68-
CPPFLAGS += -Isrc/ares/config_cygwin
68+
CPPFLAGS += -I$(S)/src/ares/config_cygwin
6969
LINKFLAGS+=
7070
UV_OS_FILE=uv-cygwin.c
7171
endif
@@ -78,20 +78,24 @@ RUNNER_LIBS=
7878
RUNNER_SRC=test/runner-unix.c
7979

8080
uv.a: src/uv-unix.o src/uv-common.o src/uv-platform.o src/ev/ev.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)
81-
$(AR) rcs uv.a src/uv-unix.o src/uv-platform.o src/uv-common.o src/uv-eio.o src/ev/ev.o \
82-
src/eio/eio.o $(CARES_OBJS)
81+
@$(call EE, ar: $@)
82+
$(Q)$(AR) rcs uv.a $^
8383

8484
src/uv-platform.o: src/$(UV_OS_FILE) include/uv.h include/uv-unix.h
85-
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/$(UV_OS_FILE) -o src/uv-platform.o
85+
@$(call EE, compile: $@)
86+
$(Q)$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
8687

8788
src/uv-unix.o: src/uv-unix.c include/uv.h include/uv-unix.h
88-
$(CC) $(CSTDFLAG) $(CPPFLAGS) -Ieio $(CFLAGS) -c src/uv-unix.c -o src/uv-unix.o
89+
@$(call EE, compile: $@)
90+
$(Q)$(CC) $(CSTDFLAG) $(CPPFLAGS) -I$(S)/eio $(CFLAGS) -c $< -o $@
8991

9092
src/uv-common.o: src/uv-common.c include/uv.h include/uv-unix.h
91-
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o
93+
@$(call EE, compile: $@)
94+
$(Q)$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
9295

9396
src/ev/ev.o: src/ev/ev.c
94-
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/ev/ev.c -o src/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"
97+
@$(call EE, compile: $@)
98+
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ -DEV_CONFIG_H=\"$(EV_CONFIG)\"
9599

96100

97101
EIO_CPPFLAGS += $(CPPFLAGS)
@@ -100,20 +104,9 @@ EIO_CPPFLAGS += -DEIO_STACKSIZE=65536
100104
EIO_CPPFLAGS += -D_GNU_SOURCE
101105

102106
src/eio/eio.o: src/eio/eio.c
103-
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/eio/eio.c -o src/eio/eio.o
107+
@$(call EE, compile: $@)
108+
$(Q)$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c $< -o $@
104109

105110
src/uv-eio.o: src/uv-eio.c
106-
$(CC) $(CPPFLAGS) -Isrc/eio/ $(CSTDFLAG) $(CFLAGS) -c src/uv-eio.c -o src/uv-eio.o
107-
108-
109-
clean-platform:
110-
-rm -f src/ares/*.o
111-
-rm -f src/ev/*.o
112-
-rm -f src/eio/*.o
113-
-rm -rf test/run-tests.dSYM run-benchmarks.dSYM
114-
115-
distclean-platform:
116-
-rm -f src/ares/*.o
117-
-rm -f src/ev/*.o
118-
-rm -f src/eio/*.o
119-
-rm -rf test/run-tests.dSYM run-benchmarks.dSYM
111+
@$(call EE, compile: $@)
112+
$(Q)$(CC) $(CPPFLAGS) -I$(S)/src/eio/ $(CSTDFLAG) $(CFLAGS) -c $< -o $@

0 commit comments

Comments
 (0)