Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes #38. Use Luis's PREFIX trick.

  • Loading branch information...
commit db2189f3b9c7ef6e0f7503a64a80d959156a3e43 1 parent 7ac17b2
@ry ry authored
Showing with 14 additions and 9 deletions.
  1. +5 −2 Makefile
  2. +6 −3 config-mingw.mk
  3. +3 −4 config-unix.mk
View
7 Makefile
@@ -28,11 +28,11 @@ endif
all: oio.a test/run-tests test/run-benchmarks
-test/run-tests: test/*.h test/run-tests.c $(RUNNER_SRC) test/runner-unix.c $(TESTS) oio.a
+test/run-tests$(E): test/*.h test/run-tests.c $(RUNNER_SRC) test/runner-unix.c $(TESTS) oio.a
$(CC) $(RUNNER_CFLAGS) $(RUNNER_LINKFLAGS) -o test/run-tests test/run-tests.c \
test/runner.c $(RUNNER_SRC) $(TESTS) oio.a
-test/run-benchmarks: test/*.h test/run-benchmarks.c test/runner.c $(RUNNER_SRC) $(BENCHMARKS) oio.a
+test/run-benchmarks$(E): test/*.h test/run-benchmarks.c test/runner.c $(RUNNER_SRC) $(BENCHMARKS) oio.a
$(CC) $(RUNNER_CFLAGS) $(RUNNER_LINKFLAGS) -o test/run-benchmarks test/run-benchmarks.c \
test/runner.c $(RUNNER_SRC) $(BENCHMARKS) oio.a
@@ -48,3 +48,6 @@ test: test/run-tests
bench: test/run-benchmarks
test/run-benchmarks
+
+clean:
+ $(RM) -f *.o *.a test/run-tests$(E) test/run-benchmarks$(E)
View
9 config-mingw.mk
@@ -18,6 +18,12 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
+# Use make -f Makefile.gcc PREFIX=i686-w64-mingw32-
+# for cross compilation
+CC = $(PREFIX)gcc
+AR = $(PREFIX)ar
+E=.exe
+
CFLAGS=-g --std=gnu89
LINKFLAGS=-lm
TESTS=test/echo-server.c test/test-*.c
@@ -33,8 +39,5 @@ oio.a: oio-win.o
oio-win.o: oio-win.c oio.h oio-win.h
$(CC) $(CFLAGS) -c oio-win.c -o oio-win.o
-clean:
- $(RM) -f *.o *.a test/run-tests.exe test/run-benchmarks.exe
-
distclean:
$(RM) -f *.o *.a
View
7 config-unix.mk
@@ -18,6 +18,9 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
+CC = $(PREFIX)gcc
+AR = $(PREFIX)ar
+E=
CFLAGS=--std=gnu89 -g
LINKFLAGS=-lm
TESTS=test/echo-server.c test/test-*.c
@@ -39,10 +42,6 @@ ev/ev.o: ev/config.h ev/ev.c
ev/config.h:
cd ev && ./configure
-clean:
- $(RM) -f *.o *.a test/run-tests test/run-benchmarks
- $(MAKE) -C ev clean
-
distclean:
$(RM) -f *.o *.a
$(MAKE) -C ev clean
Please sign in to comment.
Something went wrong with that request. Please try again.