Rduced the number of files copied for INSTALL
[libfirm] / MakeTargets
1 # Hey Emacs, this is a -*- makefile -*-
2 #
3 # libFIRM Project
4 #
5 # $Id$
6 #
7
8 .PHONY: subdir_all
9
10 all : subdir_all
11
12 # partial linking of a subdir's $(OFILES) into one file
13 subdir.o: $(OFILES)
14         rm -f $@
15         $(LD) $(LDFLAGS) -r -o $@ $^
16
17 clean: subdir_clean local_clean
18 .PHONY: local_clean
19 local_clean:
20         $(RM) $(OFILES) subdir.o core
21
22 realclean: subdir_realclean local_clean
23         $(RM) $(GENFILES) .depend TAGS
24
25 depend: subdir_depend local_depend
26 .PHONY: local_depend
27 local_depend: $(CFILES) $(filter %.h,$(SOURCES) $(GENFILES))
28 ifeq ($(strip $(CFILES)),)
29         >.depend
30 else
31         $(CC) -M $(DEFS) $(CPPFLAGS) $(filter %.c,$^) >.depend || { $(RM) .depend; false; }
32 endif
33
34
35 # Recurse into $(subdirs) for $(targets)
36 $(addprefix subdir_,$(targets)): $(subdirs)
37         +$(recurse)
38
39 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
40         cd $(topdir) && \
41         CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status >&2
42
43 # generate TAGS
44 tags:   subdir_tags local_tags
45 .PHONY: local_tags
46 local_tags:     $(TAGFILES)
47         etags -C $^
48
49 # installation
50 install:        subdir_install local_install
51 local_install:
52 ifneq ($(strip $(INSTALL_HEADERS)),)
53         $(INSTALL) -m u+rw,a+r $(addprefix $(srcdir)/,$(INSTALL_HEADERS)) $(INCLUDEDIR)
54 endif
55 ifneq ($(strip $(INSTALL_LIBS)),)
56         $(INSTALL) -m u+rw,a+r $(addprefix $(topdir)/,$(INSTALL_LIBS)) $(LIBDIR)
57 endif
58
59 # include dependencies
60 -include .depend