]> rtime.felk.cvut.cz Git - wvtest.git/blob - dotnet/wvtestrules.mk
c78bd558986555a5ae01afc3a6a5873ae2cb56b9
[wvtest.git] / dotnet / wvtestrules.mk
1 default: all
2
3 SHELL=/bin/bash
4
5 # cc -E tries to guess by extension what to do with the file.
6 # And it does other weird things. cpp seems to Just Work(tm), so use that for
7 # our C# (.cs) files
8 CSCPP=cpp
9
10 CSFLAGS=/warn:4 /debug
11 #CSFLAGS += /warnaserror
12
13 TESTRUNNER=$(WVDOTNET)/wvtestrunner.pl
14
15 # Rules for generating autodependencies on header files
16 $(patsubst %.cs.E,%.d,$(filter %.cs.E,$(FILES))): %.d: %.cs
17         @echo Generating dependency file $@ for $<
18         @set -e; set -o pipefail; rm -f $@; (\
19             ($(CSCPP) -M -MM -MQ '$@' $(CPPFLAGS) $< && echo Makefile) \
20                 | paste -s -d ' ' - && \
21             $(CSCPP) -M -MM -MQ '$<'.E $(CPPFLAGS) $< \
22         ) > $@ \
23         || (rm -f $@ && echo "Error generating dependency file." && exit 1)
24
25 include $(patsubst %.cs.E,%.d,$(filter %.cs.E,$(FILES)))
26
27 # Rule for actually preprocessing source files with headers
28 %.cs.E: %.cs
29         @rm -f $@
30         set -o pipefail; $(CSCPP) $(CPPFLAGS) -C -dI $< \
31                 | expand -8 \
32                 | sed -e 's,^#include,//#include,' \
33                 | grep -v '^# [0-9]' \
34                 >$@ || (rm -f $@ && exit 1)