Skip to content

Commit

Permalink
Generate the platform-specific .def files at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed Mar 24, 2011
1 parent 99682db commit f284c5c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 1,976 deletions.
22 changes: 20 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ RUNTIME_HDR := rt/globals.h \
rt/test/rust_test_runtime.h \
rt/test/rust_test_util.h

RUNTIME_DEF := $(S)src/rt/rustrt$(CFG_DEF_SUFFIX)
RUNTIME_DEF := rt/rustrt$(CFG_DEF_SUFFIX)
RUNTIME_INCS := -I $(S)src/rt/isaac -I $(S)src/rt/uthash
RUNTIME_OBJS := $(RUNTIME_CS:.cpp=.o)

Expand All @@ -356,7 +356,7 @@ RUSTLLVM_CS := $(addprefix rustllvm/, \
MachOObjectFile.cpp Object.cpp RustWrapper.cpp)

RUSTLLVM_HDR := rustllvm/include/llvm-c/Object.h
RUSTLLVM_DEF := $(S)src/rustllvm/rustllvm$(CFG_DEF_SUFFIX)
RUSTLLVM_DEF := rustllvm/rustllvm$(CFG_DEF_SUFFIX)

RUSTLLVM_INCS := -iquote $(CFG_LLVM_INCDIR) \
-iquote $(S)src/rustllvm/include
Expand Down Expand Up @@ -514,6 +514,24 @@ rustllvm/%.o: rustllvm/%.cpp $(MKFILES)
$(Q)ocamllex$(OPT) -q -o $@ $<


%.linux.def: %.def.in $(MKFILES)
@$(call E, def: $@)
$(Q)echo "{" > $@
$(Q)sed 's/.$$/&;/' $< >> $@
$(Q)echo "};" >> $@

%.darwin.def: %.def.in $(MKFILES)
@$(call E, def: $@)
$(Q)sed 's/^./_&/' $< > $@

ifdef CFG_WINDOWSY
%.def: %.def.in $(MKFILES)
@$(call E, def: $@)
$(Q)echo LIBRARY $* > $@
$(Q)echo EXPORTS >> $@
$(Q)sed 's/^./ &/' $< >> $@
endif

######################################################################
# Doc rules
######################################################################
Expand Down
68 changes: 0 additions & 68 deletions src/rt/rustrt.darwin.def

This file was deleted.

70 changes: 0 additions & 70 deletions src/rt/rustrt.def

This file was deleted.

70 changes: 0 additions & 70 deletions src/rt/rustrt.linux.def

This file was deleted.

Loading

0 comments on commit f284c5c

Please sign in to comment.