summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 20 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 58c41bf..79ed4c7 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ AR = ar rcs
CPPFLAGS = -O3
ifeq ($(SYSTEM),Darwin)
+ LIBCORO_CFLAGS = -DCORO_SJLJ
ARCH_FLAGS = -arch i386
LIBS = -liconv
LD = g++ -arch i386
@@ -27,6 +28,7 @@ ifeq ($(SYSTEM),Darwin)
AS = i686-apple-darwin-as -arch i386
endif
else
+ LIBCORO_CFLAGS = -DCORO_ASM
ARCH_FLAGS = -march=i686 -m32
ASFLAGS = -march=i686 --32
STRIP = strip --strip-unneeded
@@ -34,30 +36,38 @@ else
LDFLAGS += -flto -O3
endif
-INCLUDES = -Iincludes
+INCLUDES = -Iincludes -Ilibcoro
-CPPFLAGS_NO_ARCH += $(INCLUDES) -g -DSTDC_HEADERS -fexceptions -DWORDS_LITTLEENDIAN $(HAVES)
+CPPFLAGS_NO_ARCH += $(INCLUDES) -g -DSTDC_HEADERS -fexceptions -DWORDS_LITTLEENDIAN $(HAVES) $(LIBCORO_CFLAGS)
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
LDFLAGS += $(ARCH_FLAGS) $(LIBS)
vpath %.cc src:tests
+vpath %.c libcoro
BALAU_SOURCES = \
BString.cc \
Local.cc \
Main.cc \
Printer.cc \
+Task.cc \
+TaskMan.cc \
+
+LIBCORO_SOURCES = \
+coro.c \
TEST_SOURCES = \
test-String.cc \
+test-Tasks.cc \
LIB = libBalau.a
-WHOLE_SOURCES = $(BALAU_SOURCES) $(TEST_SOURCES)
+BALAU_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALAU_SOURCES) $(LIBCORO_SOURCES))))
+
+WHOLE_SOURCES = $(BALAU_SOURCES) $(LIBCORO_SOURCES) $(TEST_SOURCES)
TESTS = $(notdir $(basename $(TEST_SOURCES)))
-BALAU_OBJECTS = $(addsuffix .o, $(notdir $(basename $(BALAU_SOURCES))))
ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES))))
ALL_DEPS = $(addsuffix .dep, $(notdir $(basename $(WHOLE_SOURCES))))
@@ -77,11 +87,17 @@ libBalau.a: $(BALAU_OBJECTS)
test-String: test-String.o $(LIB)
$(LD) $(LDFLAGS) -o $@ $< ./$(LIB)
+test-Tasks: test-Tasks.o $(LIB)
+ $(LD) $(LDFLAGS) -o $@ $< ./$(LIB)
+
dep: $(ALL_DEPS)
%.dep : %.cc
$(CXX) $(CPPFLAGS_NO_ARCH) -M -MF $@ $<
+%.dep : %.c
+ $(CC) $(CPPFLAGS_NO_ARCH) -M -MF $@ $<
+
-include $(ALL_DEPS)
clean: