X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Flibrary.make;h=dfc3ba9294463925b4c36405ea4cd78842aa3ec8;hb=544d9defebb7873440e55bf679083df04d621b24;hp=1a5d50f09087cbcff7472e78860820c619a1e5c5;hpb=eebec713de8b2f03748bcb88311af7867abd51ab;p=mono.git diff --git a/mcs/class/library.make b/mcs/class/library.make index 1a5d50f0908..dfc3ba92944 100644 --- a/mcs/class/library.make +++ b/mcs/class/library.make @@ -1,21 +1,61 @@ -MCSTOOL = ../../mcs-tool +#USE_SOURCE_RULES=1 +RUNTIME = mono +MCS = $(RUNTIME) $(topdir)/mcs/mcs.exe MCS_FLAGS = --target library --noconfig +INSTALL = /usr/bin/install +prefix = /usr -all: $(LIBRARY) + +SOURCES_CMD=find . \ + ! \( $(SOURCES_INCLUDE:%=! -path '%' ) \) -a \ + \( $(SOURCES_EXCLUDE:%=! -path '%' ) ! -path '/dev/null' \) -a \ + ! -path '*/__*.cs' + + +all: .makefrag $(LIBRARY) clean: - -rm -rf $(LIBRARY) .response .makefrag + -rm -rf $(LIBRARY) .response .makefrag library-deps.stamp + + +ifdef USE_SOURCE_RULES + +.PHONY: .makefrag +.makefrag: + @echo -n "SOURCES=" >$@ + @$(SOURCES_CMD) | tee .response | sed -e 's/$$/ \\/' >>$@ + +else .response: $(LIB_LIST) - cat $^ |egrep '\.cs$$' >$@ + cat $^ |egrep '\.cs[[:space:]]*$$' >$@ -.makefrag: $(LIB_LIST) - echo -n "library-deps: " >$@.new - cat $^ |egrep '\.cs$$' | sed -e 's,\.cs,.cs \\,' >>$@.new +.makefrag: $(LIB_LIST) $(topdir)/class/library.make + echo -n "library-deps.stamp: $(LIB_LIST) " >$@.new + cat $< |egrep '\.cs$$' | sed -e 's,\.cs,.cs \\,' >>$@.new cat $@.new |sed -e '$$s, \\$$,,' >$@ + echo -e "\ttouch library-deps.stamp" >>$@ rm -rf $@.new +endif + -include .makefrag -$(LIBRARY): .response .makefrag #library-deps - $(MCSTOOL) $(MCS_FLAGS) -o $(LIBRARY) $(LIB_FLAGS) @.response +ifdef USE_SOURCE_RULES +$(LIBRARY): makefile.gnu $(SOURCES) $(topdir)/class/library.make +else +$(LIBRARY): .response library-deps.stamp +endif + MONO_PATH=$(MONO_PATH_PREFIX)$(MONO_PATH) $(MCS) $(MCS_FLAGS) -o $(LIBRARY) $(LIB_FLAGS) @.response + +install: all + mkdir -p $(prefix)/lib/ + $(INSTALL) -m 644 $(LIBRARY) $(prefix)/lib/ + +ifdef TEST_DIR +test: + $(MAKE) -C $(TEST_DIR) -f makefile.gnu $@ +else +test: +endif +