Welcome to mirror list, hosted at ThFree Co, Russian Federation.

library.make « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f1b4af4e6efcb71cfab7b5dd33874aa2f8700fff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#USE_SOURCE_RULES=1
MCS = mono $(topdir)/mcs/mcs.exe
MCS_FLAGS = --target library --noconfig
INSTALL = /usr/bin/install
prefix = /usr


SOURCES_CMD=find . \
	! \( $(SOURCES_INCLUDE:%=! -path '%' ) \) -a	\
	  \( $(SOURCES_EXCLUDE:%=! -path '%' ) \) -a	\
	  ! -path '*/__*.cs'


all: .makefrag $(LIBRARY)

clean:
	-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$$' >$@

.makefrag: $(LIB_LIST) $(topdir)/class/library.make
	echo -n "library-deps.stamp: " >$@.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

ifdef USE_SOURCE_RULES
$(LIBRARY): $(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/