Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean up messy makefiles

There was still a lot of build cruft sitting around from the node 0.4.x
branch which required the LD_PRELOAD hook. Since LD_PRELOAD is no longer
needed there's no reason to build coroutine.cc as a shared library.

Fixes gh-37
  • Loading branch information...
commit b719c73a638ba6854d0fcf02eb1c0fe88079e011 1 parent 9e00a06
@laverdet authored
Showing with 9 additions and 20 deletions.
  1. +2 −6 Makefile
  2. +1 −1  package.json
  3. +6 −11 src/Makefile
  4. +0 −2  src/platform.mk
View
8 Makefile
@@ -1,16 +1,12 @@
include src/platform.mk
-COROUTINE_SO_FULL := $(shell echo `pwd`/src/$(COROUTINE_SO))
FIBERS_SO := $(shell echo `pwd`/src/fibers.node)
all: fibers test
-fibers: $(COROUTINE_SO_FULL) $(FIBERS_SO)
+fibers: $(FIBERS_SO)
dist: man
-$(COROUTINE_SO_FULL):
- $(MAKE) -C src $(COROUTINE_SO)
-
$(FIBERS_SO):
$(MAKE) -C src fibers.node
@@ -25,4 +21,4 @@ clean:
$(MAKE) -C src clean
$(RM) -r man
-.PHONY: clean dist fibers test $(COROUTINE_SO_FULL) $(FIBERS_SO)
+.PHONY: clean dist fibers test $(FIBERS_SO)
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "fibers",
- "version": "0.6.1",
+ "version": "0.6.2",
"description": "Cooperative multi-tasking for Javascript; or, the closest thing to a thread you'll see in node",
"keywords": [
"fiber", "fibers", "coroutine", "thread", "async", "parallel", "worker", "future", "promise"],
View
17 src/Makefile
@@ -1,28 +1,23 @@
include platform.mk
-COROUTINE_SO_FULL := $(shell echo `pwd`/$(COROUTINE_SO))
ifeq ($(NODE_PLATFORM), linux)
- CPP_DYFLAGS = -fPIC -shared
CPP_NODEFLAGS = -fPIC -shared -Wl,-Bdynamic
endif
ifeq ($(NODE_PLATFORM), darwin)
- CPP_DYFLAGS = -dynamiclib
CPP_NODEFLAGS = -bundle -undefined dynamic_lookup
endif
-all: $(COROUTINE_SO_FULL) fibers.node
+all: fibers.node
libcoro.o: libcoro/coro.c
$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $^
-$(COROUTINE_SO_FULL): $(COROUTINE_SO)
+coroutine.o: coroutine.cc
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $^
-$(COROUTINE_SO): coroutine.cc libcoro.o
- $(CXX) $(CPP_DYFLAGS) $(CXXFLAGS) $(CPPFLAGS) -o $(COROUTINE_SO_FULL) $^ -lpthread -ldl
-
-fibers.node: fibers.cc $(COROUTINE_SO_FULL)
- $(CXX) $(CPP_NODEFLAGS) $(CPPFLAGS) $^ -o $@
+fibers.node: fibers.cc coroutine.o libcoro.o
+ $(CXX) $(CPP_NODEFLAGS) $(CPPFLAGS) $^ -o $@ -lpthread
clean:
- -$(RM) fibers.node libcoro.o $(COROUTINE_SO)
+ -$(RM) fibers.node libcoro.o coroutine.o
-$(RM) -r *.dSYM
View
2  src/platform.mk
@@ -23,10 +23,8 @@ endif
ifeq ($(NODE_PLATFORM), linux)
# SJLJ in linux = hangs & segfaults
CPPFLAGS += -DCORO_UCONTEXT
- COROUTINE_SO = coroutine.so
endif
ifeq ($(NODE_PLATFORM), darwin)
# UCONTEXT in os x = hangs & segfaults :(
CPPFLAGS += -DCORO_SJLJ
- COROUTINE_SO = coroutine.dylib
endif
Please sign in to comment.
Something went wrong with that request. Please try again.