diff --git a/build.mk b/build.mk index 7d8a3be7..6cba169f 100644 --- a/build.mk +++ b/build.mk @@ -143,7 +143,7 @@ TESTS= \ test/test-util.o \ test/test-walk-handles.o \ -all: libuv.a +.PHONY: all bench clean clean-platform distclean test run-tests$(E): test/run-tests.o test/runner.o $(RUNNER_SRC) $(TESTS) libuv.a $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS) @@ -153,10 +153,6 @@ run-benchmarks$(E): test/run-benchmarks.o test/runner.o $(RUNNER_SRC) $(BENCHMAR test/echo.o: test/echo.c test/echo.h - -.PHONY: clean clean-platform distclean test bench - - test: run-tests$(E) $(CURDIR)/$< diff --git a/config-unix.mk b/config-unix.mk index 90887305..d230bb25 100644 --- a/config-unix.mk +++ b/config-unix.mk @@ -29,7 +29,7 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 RUNNER_SRC=test/runner-unix.c RUNNER_CFLAGS=$(CFLAGS) -I$(SRCDIR)/test -RUNNER_LDFLAGS=-L"$(CURDIR)" -luv +RUNNER_LDFLAGS= DTRACE_OBJS= DTRACE_HEADER= @@ -159,6 +159,13 @@ endif RUNNER_LDFLAGS += $(LDFLAGS) +all: + # Force a sequential build of the static and the shared library. + # Works around a make quirk where it forgets to (re)build either + # the *.o or *.pic.o files, depending on what target comes first. + $(MAKE) -f $(SRCDIR)/Makefile libuv.a + $(MAKE) -f $(SRCDIR)/Makefile libuv.$(SOEXT) + libuv.a: $(OBJS) $(AR) rcs $@ $^