Use LTTngUSTLogger logger plugin in logtest regression test
[deliverable/titan.core.git] / Makefile.genrules
CommitLineData
d44e3c4f 1##############################################################################
2# Copyright (c) 2000-2016 Ericsson Telecom AB
970ed795
EL
3# All rights reserved. This program and the accompanying materials
4# are made available under the terms of the Eclipse Public License v1.0
5# which accompanies this distribution, and is available at
6# http://www.eclipse.org/legal/epl-v10.html
d44e3c4f 7#
8# Contributors:
9# Balasko, Jeno
10# Baranyi, Botond
11# Forstner, Matyas
12# Kovacs, Ferenc
13# Pandi, Krisztian
14# Raduly, Csaba
15# Szabo, Janos Zoltan – initial implementation
16#
17##############################################################################
970ed795
EL
18# General stuff (to be included at the end of makefiles). The
19# following variables are used: DEPFILES, SUBDIRS...
20
21tags: $(SOURCES)
22ifdef SUBDIRS
23 @for i in $(SUBDIRS) ; do \
24 (cd $$i && $(MAKE) tags) || exit 1; \
25 done
26endif
27 etags --members *.hh *.h *.c *.cc
28
29dep:
30ifdef SUBDIRS
31 @for i in $(SUBDIRS) ; do \
32 (cd $$i && $(MAKE) dep) || exit 1; \
33 done
34endif
35ifdef DEPFILES
36 $(MAKE) $(DEPFILES)
37endif
38
39clean:
40ifdef SUBDIRS
41 @for i in $(SUBDIRS) ; do \
42 (cd $$i && $(MAKE) clean) || exit 1; \
43 done
44endif
45 $(RM) $(TARGETS) $(OBJECTS) $(TOBECLEANED)
46
47distclean:
48ifdef SUBDIRS
49 @for i in $(SUBDIRS) ; do \
50 (cd $$i && $(MAKE) distclean) || exit 1; \
51 done
52endif
53 $(RM) $(TARGETS) $(OBJECTS) $(TOBECLEANED) \
54 $(GENERATED_HEADERS) $(GENERATED_SOURCES) \
55 $(GENERATED_OTHERS) \
56 $(DEPFILES) TAGS *.gcno *.gcda
57
58# This target allows us to "make ../clean"
59../% $(foreach dir, $(SUBDIRS), $(dir)/%):
60 cd $(dir $@) && $(MAKE) $(notdir $@)
61
62# General rules to compile C(++) files.
63#
64# These macros implement "silent" rules during building.
65# Define the V make variable or environment variable to a nonzero value to get
66# the exact call to the compiler: e.g. make V=1
67#
68# Define the VD variable to get the exact (verbose) action while
69# generating dependencies.
70#
71NULL :=
72SPACE := ${NULL} ${NULL}
73
74DEF_V := 0
75DEF_VD:= 0
76
77V_CC_0 = @echo " (CC) " $<;$(SPACE)
78V_CXX_0 = @echo " (C++) " $<;$(SPACE)
79V_DEP_0 = @echo " (dep) " $<;$(SPACE)
80
81V_CC_ = $(V_CC_$(DEF_V))
82V_CXX_ = $(V_CXX_$(DEF_V))
83V_DEP_ = $(V_DEP_$(DEF_VD))
84
85V_CC = $(V_CC_$(V))
86V_CXX = $(V_CXX_$(V))
87V_DEP = $(V_DEP_$(VD))
88
89%.o: %.c
90 $(V_CC)$(CC) -c $(CPPFLAGS) $(CCFLAGS) $< -o $@
91
3abe9331 92# Special rule for building profmerge files
93%.profmerge.o: %.cc
94 $(V_CXX)$(CXX) -c -DPROF_MERGE $(CPPFLAGS) $(CXXFLAGS) $< -o $@
95
970ed795
EL
96%.o: %.cc
97 $(V_CXX)$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@
98
99# Preprocess C/C++ files
100%.i: %.c
101 $(CC) -E $(CPPFLAGS) $(CCFLAGS) \
102 $< > $@
103
104%.ii: %.cc
105 $(CXX) -E $(CPPFLAGS) $(CXXFLAGS) \
106 $< > $@
107
108# General rules to create the dependency file.
109
110%.d: %.c
111 $(V_DEP)set -e; $(CC) $(CCDEPFLAG) $(CPPFLAGS) $< \
112 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@; \
113 [ -s $@ ] || rm -f $@
114
115%.d: %.cc
116 $(V_DEP)set -e; $(CXX) $(CXXDEPFLAG) $(CPPFLAGS) $< \
117 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@; \
118 [ -s $@ ] || rm -f $@
119
120ifdef DEPFILES
121 ifndef MAKECMDGOALS
122 DEPFILES_NEEDED := yes
123 else
124 DEPFILES_NEEDED := $(filter-out clean distclean, $(MAKECMDGOALS))
125 endif
126 ifdef DEPFILES_NEEDED
127 DEPFILES_INCLUDE := $(filter-out $(MAKECMDGOALS), $(DEPFILES))
128 ifdef DEPFILES_INCLUDE
129 ifeq (,$(findstring n,$(MAKEFLAGS)))
130 # -n was *not* given to make
131 -include $(DEPFILES_INCLUDE)
132 endif
133 endif
134 endif
135endif
136
137# Building PDFs from man pages (for MinGW)
138%.pdf: %.1
139 man2pdf ./$< $@
140# The "./" prefix is important, it tells man that the input is a filename,
141# so it shouldn't search through MANPATH.
142
143# List of fake targets:
144.PHONY: all install tags dep clean distclean
145
146# Disable all built-in suffix rules of make
147.SUFFIXES:
148
149# Do not delete generated headers while building .d files
150# (.PRECIOUS would also keep them if make is killed)
151.SECONDARY: $(GENERATED_HEADERS)
152
153ifdef SRCDIR
154
155REQUIRED_MAKE_VERSION = 3.81
156# 3.80 is known not to work; 3.82 does work
157REAL_MAKE_VERSION = $(firstword $(MAKE_VERSION))
158EARLIER_MAKE_VERSION = $(firstword $(sort $(REAL_MAKE_VERSION) $(REQUIRED_MAKE_VERSION)))
159ifeq "$(REQUIRED_MAKE_VERSION)" "$(EARLIER_MAKE_VERSION)"
160
161# Declare a search path for every source.
162# "vpath %.cc $(ABS_SRC)" would lump in generated .cc files,
163# potentially picking up generated files laying around in the source dir
164# instead of generating them in the build dir.
165$(foreach src, $(STATIC_SOURCES) $(ORIGINATORS), $(eval vpath $(src) $(ABS_SRC)))
166
167else
168
169# alas, make 3.80 can't cope with the "foreach/eval vpath" above
170#$(warning no OOBE with make $(MAKE_VERSION))
171
172endif
173
174endif
This page took 0.029461 seconds and 5 git commands to generate.