source: to-imperative/trunk/samples/samples.mk @ 842

Last change on this file since 842 was 842, checked in by pooh, 18 years ago
  • Reorganized samples and tests making process.
  • Added new make targets samples', tests' and `check'.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1CPPFLAGS += -I$(TOPDIR)/runtime -I$(TOPDIR)/libp++
2CPPFLAGS += -I$(TOPDIR)/library/include
3CPPFLAGS += -DALL_INLINE #-DRFRT_DISABLE_TAIL_RECURSION
4#CFLAGS += -finline-limit=10000 -march=pentium3
5
6SAMPLES_SOURCES  = $(SAMPLES:=.cc)
7SAMPLES_SOURCES += $(SAMPLES:=.rf)
8DEPS = $(SAMPLES:=.dep)
9
10DISTFILES = Makefile
11DISTFILES += $(SAMPLES_SOURCES)
12
13RFPC = $(TOPDIR)/compiler/rfpc
14LIBRF = $(TOPDIR)/library/librf.a
15LIBRFRT = $(TOPDIR)/runtime/librfrt.a
16LIBPXX = $(TOPDIR)/libp++/libp++.a
17
18#$(SAMPLES): $(LIBRFRT)
19
20LDFLAGS += -L$(TOPDIR)/library -L$(TOPDIR)/runtime
21LDFLAGS += -L$(TOPDIR)/libp++ -L$(TOPDIR)/libstdc++-stub
22LDLIBS += -lrf -lrfrt -lp++ -lsupc++
23
24%.cc: %.rf $(RFPC)
25        $(RFPC) -cc $<
26
27%.o: %.cc %.rf
28#       $(RFPC) -cc $<
29        $(CXX) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(<:.rf=.cc)
30
31$(SAMPLES): %: %.o $(LIBRF) $(LIBRFRT) $(LIBPXX)
32        $(CXX) -o $@ $< $(LDFLAGS) $(LDLIBS)
33
34$(TESTS): %: %.o $(LIBRF) $(LIBRFRT) $(LIBPXX)
35        $(CXX) -o $@ $< $(LDFLAGS) $(LDLIBS)
36
37clean::
38        rm -f $(SAMPLES) $(TESTS) *.o *.dep
39
40check:: $(TESTS)
41        @$(foreach target,$(TESTS), \
42          $(TOPDIR)/samples/check.sh $(target) ; \
43        )
44
45DEPS = $(SAMPLES:=.dep)
46DEPS += $(TESTS:=.dep)
Note: See TracBrowser for help on using the repository browser.