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
|
|
|
|
|
|
|
|
ifeq ($(shell uname),Darwin)
|
|
|
|
DYLIB_GLOB = lib$(1)*.dylib
|
|
|
|
DYLIB = $(TMPDIR)/lib$(1).dylib
|
|
|
|
else
|
|
|
|
DYLIB_GLOB = lib$(1)*.so
|
|
|
|
DYLIB = $(TMPDIR)/lib$(1).so
|
|
|
|
endif
|
|
|
|
|
|
|
|
%.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
|
2013-11-16 19:07:32 -06:00
|
|
|
$(TMPDIR)/lib%.o: %.c
|
|
|
|
$(CC) -c -o $@ $<
|
|
|
|
|