mips backend updates:
[libfirm] / MakeTargets
1 #
2 # Project:     libFIRM
3 # File name:   MakeTargets
4 # Purpose:
5 # Author:      nicht Till Riedel, das waren andere
6 # Modified by:
7 # Created:
8 # CVS-ID:      $Id$
9 # Copyright:   (c) 2002-2003 Universität Karlsruhe
10 # Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11 #
12
13 .PHONY: subdir_all
14
15 all : subdir_all
16
17 # partial linking of a subdir's $(OFILES) into one file
18 subdir.o: $(OFILES)
19 ifeq ($(strip $(OFILES)),)
20         >$@
21 else
22         rm -f $@
23         $(LD) $(LDFLAGS)  -r -o $@ $^
24 endif
25
26 clean: subdir_clean local_clean
27 .PHONY: local_clean
28 local_clean:
29         $(RM) $(OFILES) subdir.o core
30
31 realclean: subdir_realclean local_clean
32         $(RM) $(GENFILES) .depend TAGS $(TARDIRNAME)
33
34 depend: subdir_depend local_depend
35 .PHONY: local_depend
36 local_depend: $(CFILES) $(filter %.h,$(SOURCES) $(GENFILES))
37 ifeq ($(strip $(CFILES)),)
38         >.depend
39 else
40         $(CC) -M $(DEFS) $(CPPFLAGS) $(filter %.c,$^) >.depend || { $(RM) .depend; false; }
41 endif
42
43
44 # generate an archive for distribution
45 distrib: dist
46         $(MAKE) -C testprograms dist
47
48 dist:   subdir_dist local_dist $(TARDIRNAME)
49 #       @echo create archive with $(DISTFILES)
50 #       @echo tar -C $(top_srcdir) -uf libfirm.tar $(ARCHIVEDISTFILES)
51         $(TAR) $(TARFLAGS) $(ARCHIVEDISTFILES)
52 .PHONY: local_dist
53 local_dist:     $(DISTFILES)
54
55 $(TARDIRNAME):
56         $(LN_S) $(top_srcdir) $@
57
58 # dont know about this
59 # Recurse into $(subdirs) for $(targets)
60 $(addprefix subdir_,$(targets)): $(subdirs)
61         +$(recurse)
62
63 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
64         cd $(topdir) && \
65         CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status >&2
66
67 # generate TAGS
68 .PHONY: tags
69 tags:   TAGS
70 TAGS:
71         ctags -R *.[ch]
72
73 # installation
74 install:        $(INCLUDEDIR) $(INCLUDEDIR)/adt install_headers $(LIBDIR) install_libs
75         $(INSTALL) -m u+rwx,a+rx $(addprefix $(topdir)/,libfirm.pc) $(LIBDIR)/pkgconfig
76         @echo ================================================
77         @echo Don\'t forget to add $(LIBDIR) to LD_LIBRARY_PATH
78         @echo Don\'t forget to add /usr/public/libxml2/lib to LD_LIBRARY_PATH
79         @echo ================================================
80
81 install_headers:        subdir_install_headers local_install_headers
82 local_install_headers:
83 ifneq ($(strip $(INSTALL_HEADERS)),)
84         $(INSTALL)  -m u+rw,a+r $(addprefix $(srcdir)/,$(INSTALL_HEADERS)) $(INCLUDEDIR)
85 endif
86 ifneq ($(strip $(INSTALL_GENERATED_HEADERS)),)
87         $(INSTALL)  -m u+rw,a+r $(INSTALL_GENERATED_HEADERS) $(INCLUDEDIR)
88 endif
89 ifneq ($(strip $(INSTALL_HEADERS_ADT)),)
90         $(INSTALL)  -m u+rw,a+r $(addprefix $(srcdir)/,$(INSTALL_HEADERS_ADT)) $(INCLUDEDIR)/adt
91 endif
92
93 install_libs:           subdir_install_libs local_install_libs
94 local_install_libs:
95 ifneq ($(strip $(INSTALL_LIBS)),)
96         $(INSTALL)  -m u+rw,a+r $(addprefix $(topdir)/,$(INSTALL_LIBS)) $(LIBDIR)
97         @# the '.a' is ranlib'ed already, and the '.so' doesn't need ranlib-ing
98         @# $(RANLIB) $(addprefix $(LIBDIR)/,$(INSTALL_LIBS))
99 endif
100
101
102 $(LIBDIR):
103         mkdir -p $@
104
105 $(INCLUDEDIR):
106         mkdir -p $@
107
108 $(INCLUDEDIR)/adt:
109         mkdir -p $@
110
111 # generated the directory where all the generated documentation is
112 $(AUTODOCDIR):
113         mkdir -p $@
114
115 # print some help
116 .PHONY: help
117 help:
118         @echo "possible targets are:"
119         @echo "[$(targets)]"
120         @echo "but not all of them should be used or make sense"
121
122 # include dependencies
123 -include .depend