source: to-imperative/trunk/rules.mk @ 770

Last change on this file since 770 was 336, checked in by pooh, 18 years ago
  • Rules for .rf -> .o compilation are moved from rules.mk to

compiler/Makefile, because they are for old Refal+ compiler, so they
shouldn't be default.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1TOPDIR ?= .
2CURRENTDIR ?= .
3DISTLIST ?= dist.list
4
5-include $(TOPDIR)/config.mk
6
7%.dep: %.c
8        @echo Generating dependencies for $<
9        @$(CC) $(CPPFLAGS) -M $< | \
10          sed 's/\($*\)\.o[ :]*/\1.o \1.dbg.o $@ : /g' > $@;
11
12%.dep: %.cc
13        @echo Generating dependencies for $<
14        @$(CXX) $(CPPFLAGS) -M $< | \
15          sed 's/\($*\)\.o[ :]*/\1.o \1.dbg.o $@ : /g' > $@;
16
17#%.o: %.rf Makefile $(TOPDIR)/config.mk
18#       $(RFPC) $<
19
20%.o: %.c Makefile $(TOPDIR)/config.mk
21        $(CC) $(CPPFLAGS) $(WFLAGS) $(OFLAGS) $(CFLAGS) -c -o $@ $<
22
23%.o: %.cc Makefile $(TOPDIR)/config.mk
24        $(CXX) $(CPPFLAGS) $(WFLAGS) $(OFLAGS) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<
25
26%.dbg.o: %.c Makefile $(TOPDIR)/config.mk
27        $(CC) $(CPPFLAGS) $(WFLAGS) $(DFLAGS) $(CFLAGS) -c -o $@ $<
28
29%.dbg.o: %.cc Makefile $(TOPDIR)/config.mk
30        $(CXX) $(CPPFLAGS) $(WFLAGS) $(DFLAGS) $(CFLAGS) $(CXXFLAGS) -c -o $@ $<
31
32DO_SUBDIRS=$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) \
33  TOPDIR=$(TOPDIR)/.. INSTALL_DIR=$(INSTALL_DIR) $@ \
34  CURRENTDIR=$(CURRENTDIR)/$(dir) DISTNAME="$(DISTNAME)" \
35  || exit 1; )
36
37all::
38        $(DO_SUBDIRS)
39
40clean::
41        $(DO_SUBDIRS)
42        rm -f core
43
44distclean:: clean
45        $(DO_SUBDIRS)
46
47dist::
48        if [ -f "$(DISTLIST)" ]; then rm $(DISTLIST); fi
49        $(DO_SUBDIRS)
50        echo $(foreach file, $(DISTFILES), $(CURRENTDIR)/$(file)) \
51          >>$(TOPDIR)/$(DISTLIST)
52
53snapshot::
54        if [ -f "$(DISTLIST)" ]; then rm $(DISTLIST); fi
55        $(DO_SUBDIRS)
56        echo $(foreach file, $(DISTFILES), $(CURRENTDIR)/$(file)) \
57          >>$(TOPDIR)/$(DISTLIST)
58
59check:: all
60        $(DO_SUBDIRS)
61
62docs:: all
63        $(DO_SUBDIRS)
64
65publish:: all
66        $(DO_SUBDIRS)
67
68install:: all
69        $(DO_SUBDIRS)
70
71uninstall::
72        $(DO_SUBDIRS)
73
74.PHONY: all check install uninstall clean dist snapshot distclean
Note: See TracBrowser for help on using the repository browser.