Skip to content

Commit

Permalink
Rework the makefile to work on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
kersny committed Jul 12, 2011
1 parent 8f030a7 commit 04b5b93
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ else
include config-unix.mk
endif

all: build/webserver.exe build/libuvwrap.dylib
all: build/webserver.exe build/libuvwrap.$(STATIC_LIBRARY)

build/webserver.exe: webserver.cs webserver.csproj
$(CSBUILD) webserver.csproj

libuv/uv.a:
$(UVFLAGS) $(MAKE) -C libuv

build/libuvwrap.dylib: libuv/uv.a uv_wrap.c
$(CC) -dynamiclib uv_wrap.c -m32 -o build/libuvwrap.dylib libuv/uv.a
$(CC) -shared uv_wrap.c -m32 -o build/libuvwrap.so libuv/uv.a
build/libuvwrap.%: libuv/uv.a uv_wrap.c
$(CC) $($(STATIC_LIBRARY)) uv_wrap.c -m32 -o build/libuvwrap.$(STATIC_LIBRARY) libuv/uv.a

clean:
$(RM) -rf build/
$(RM) -r build/
$(RM) uv_wrap.c.*
$(MAKE) -C libuv clean
11 changes: 10 additions & 1 deletion config-unix.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
CSBUILD=xbuild
UVFLAGS=CPPFLAGS=-m32
UVFLAGS=CPPFLAGS="-m32"
CC=$(PREFIX)gcc

STATIC_LIBRARY=so

ifeq (Darwin,$(uname_S))
STATIC_LIBRARY=dylib
endif

so=-shared
dylib=-dynamiclib

0 comments on commit 04b5b93

Please sign in to comment.