source: PSPA/madxPSPA/make/depend.rules @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 1.4 KB
Line 
1# |
2# o---------------------------------------------------------------------o
3# |
4# | MAD makefile - depend rules
5# |
6# o---------------------------------------------------------------------o
7# |
8# | Methodical Accelerator Design
9# |
10# | Copyright (c) 2011+ CERN, mad@cern.ch
11# |
12# | For more information, see http://cern.ch/mad
13# |
14# o---------------------------------------------------------------------o
15# |
16# | $Id$
17# |
18
19vpath %.d   $(OBJDIR)
20vpath %.mod $(OBJDIR)
21
22#
23# rule for C dependencies
24#
25$(OBJDIR)/%.d: %.c
26        $E "*** Computing $(@F)"
27        $_ $(call CC_tr,$(CDEP) $(CPPFLAGS) $<) $(CDEP_tr) > $@
28
29#
30# rule for C++ dependencies
31#
32$(OBJDIR)/%.d: %.cpp
33        $E "*** Computing $(@F)"
34        $_ $(call CXX_tr,$(CXXDEP) $(CPPFLAGS) $<) $(CXXDEP_tr) > $@
35
36#
37# rule for f90 and F90 dependencies
38#
39$(OBJDIR)/%.d: %.f90
40        $E "*** Computing $(@F)"
41        $_ $(call FC_tr,$(FDEP) $<) $(FDEP_tr) > $@
42
43$(OBJDIR)/%.d: %.F90
44        $E "*** Computing $(@F)"
45        $_ $(call FC_tr,$(FDEP) $(CPPFLAGS) $<) $(FDEP_tr) > $@
46
47#
48# compute dependencies
49#
50C_DEPS   := $(patsubst %.c,%.d,$(CC_SRC))
51CXX_DEPS := $(patsubst %.cpp,%.d,$(CXX_SRC))
52F_DEPS   := $(patsubst %.F90,%.d,$(patsubst %.f90,%.d,$(FC_SRC)))
53DEPENDS  :=
54
55ifneq ($(CDEP),)
56DEPENDS += $(C_DEPS)
57endif
58
59ifneq ($(CXXDEP),)
60DEPENDS += $(CXX_DEPS)
61endif
62
63ifneq ($(FDEP),)
64DEPENDS += $(F_DEPS)
65endif
66
67#
68# include dependencies
69#
70ifneq ($(filter $(BUILDGOALS),$(MAKECMDGOALS)),)
71-include $(addprefix $(OBJDIR)/,$(DEPENDS))
72endif
73
74# end of makefile
75
Note: See TracBrowser for help on using the repository browser.