2014-02-21 18:32:49 -06:00
|
|
|
export LD_LIBRARY_PATH:=$(TMPDIR):$(LD_LIBRARY_PATH)
|
|
|
|
export DYLD_LIBRARY_PATH:=$(TMPDIR):$(DYLD_LIBRARY_PATH)
|
|
|
|
|
2013-11-16 19:07:32 -06:00
|
|
|
RUSTC := $(RUSTC) --out-dir $(TMPDIR) -L $(TMPDIR)
|
|
|
|
CC := $(CC) -L $(TMPDIR)
|
|
|
|
|
|
|
|
RUN = $(TMPDIR)/$(1)
|
|
|
|
FAILS = $(TMPDIR)/$(1) && exit 1 || exit 0
|
|
|
|
|
|
|
|
RLIB_GLOB = lib$(1)*.rlib
|
|
|
|
STATICLIB = $(TMPDIR)/lib$(1).a
|
|
|
|
STATICLIB_GLOB = lib$(1)*.a
|
2014-04-27 02:52:36 -05:00
|
|
|
BIN = $(1)
|
2013-11-16 19:07:32 -06:00
|
|
|
|
2014-04-27 02:52:36 -05:00
|
|
|
UNAME = $(shell uname)
|
|
|
|
ifneq (,$(findstring MINGW,$(UNAME)))
|
|
|
|
IS_WINDOWS=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(UNAME),Darwin)
|
2013-11-16 19:07:32 -06:00
|
|
|
DYLIB_GLOB = lib$(1)*.dylib
|
|
|
|
DYLIB = $(TMPDIR)/lib$(1).dylib
|
|
|
|
else
|
2014-04-27 02:52:36 -05:00
|
|
|
ifdef IS_WINDOWS
|
|
|
|
DYLIB_GLOB = $(1)*.dll
|
|
|
|
DYLIB = $(TMPDIR)/$(1).dll
|
|
|
|
BIN = $(1).exe
|
|
|
|
export PATH := $(PATH):$(LD_LIBRARY_PATH)
|
|
|
|
else
|
2013-11-16 19:07:32 -06:00
|
|
|
DYLIB_GLOB = lib$(1)*.so
|
|
|
|
DYLIB = $(TMPDIR)/lib$(1).so
|
|
|
|
endif
|
2014-04-27 02:52:36 -05:00
|
|
|
endif
|
2013-11-16 19:07:32 -06:00
|
|
|
|
|
|
|
%.a: %.o
|
|
|
|
ar crus $@ $<
|
|
|
|
%.dylib: %.o
|
2013-11-28 20:03:38 -06:00
|
|
|
$(CC) -dynamiclib -Wl,-dylib -o $@ $<
|
2013-11-16 19:07:32 -06:00
|
|
|
%.so: %.o
|
2013-11-28 20:03:38 -06:00
|
|
|
$(CC) -o $@ $< -shared
|
2014-04-27 02:52:36 -05:00
|
|
|
%.dll: lib%.o
|
|
|
|
$(CC) -o $@ $< -shared
|
|
|
|
|
2013-11-16 19:07:32 -06:00
|
|
|
$(TMPDIR)/lib%.o: %.c
|
|
|
|
$(CC) -c -o $@ $<
|
|
|
|
|