config-mingw.mk 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  2. #
  3. # Permission is hereby granted, free of charge, to any person obtaining a copy
  4. # of this software and associated documentation files (the "Software"), to
  5. # deal in the Software without restriction, including without limitation the
  6. # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  7. # sell copies of the Software, and to permit persons to whom the Software is
  8. # furnished to do so, subject to the following conditions:
  9. #
  10. # The above copyright notice and this permission notice shall be included in
  11. # all copies or substantial portions of the Software.
  12. #
  13. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  18. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  19. # IN THE SOFTWARE.
  20. # Use make -f Makefile.gcc PREFIX=i686-w64-mingw32-
  21. # for cross compilation
  22. CC = $(PREFIX)gcc
  23. AR = $(PREFIX)ar
  24. E=.exe
  25. CFLAGS=$(CPPFLAGS) -g --std=gnu89 -D_WIN32_WINNT=0x0600
  26. LDFLAGS=-lm
  27. WIN_SRCS=$(wildcard $(SRCDIR)/src/win/*.c)
  28. WIN_OBJS=$(WIN_SRCS:.c=.o)
  29. RUNNER_CFLAGS=$(CFLAGS) -D_GNU_SOURCE # Need _GNU_SOURCE for strdup?
  30. RUNNER_LDFLAGS=$(LDFLAGS)
  31. RUNNER_LIBS=-lws2_32 -lpsapi -liphlpapi
  32. RUNNER_SRC=test/runner-win.c
  33. libuv.a: $(WIN_OBJS) src/fs-poll.o src/inet.o src/uv-common.o src/version.o
  34. $(AR) rcs $@ $^
  35. src/%.o: src/%.c include/uv.h include/uv-private/uv-win.h
  36. $(CC) $(CFLAGS) -c $< -o $@
  37. src/win/%.o: src/win/%.c include/uv.h include/uv-private/uv-win.h src/win/internal.h
  38. $(CC) $(CFLAGS) -o $@ -c $<
  39. clean-platform:
  40. -rm -f src/win/*.o