File: bottom.make

package info (click to toggle)
exactimage 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,940 kB
  • sloc: cpp: 35,715; ansic: 1,730; xml: 1,447; makefile: 323; perl: 138; sh: 108; python: 45; php: 37; ruby: 12
file content (77 lines) | stat: -rw-r--r-- 2,766 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
include build/$(X_SYSTEM).make

X_SRCS = $(filter-out $(NOT_SRCS), $(sort $(notdir $(wildcard $(X_MODULE)/*.cc $(X_MODULE)/*.c $(X_MODULE)/*.m $(X_MODULE)/*.mm)))) $(SRCS)

$(X_MODULE)_OBJS := $(addsuffix $(X_OBJEXT),$(addprefix $($(X_MODULE)_OUTPUT)/,$(basename $(X_SRCS)))) $(DEPS)

$(X_MODULE)_BINARY := $(addsuffix $(BINARY_EXT),$(addprefix $($(X_MODULE)_OUTPUT)/,$(BINARY)))



X_DEP_FILES := $(addsuffix .d,$(addprefix $($(X_MODULE)_OUTPUT)/,$(basename $(X_SRCS)))) # $(DEPS)



# include build/$(X_ARCH).make
# include build/$(X_CC).make

# dependencies

ifneq ($(X_DEP_FILES),)
  -include $(X_DEP_FILES)
endif

# rules

Q = 

ifneq ($(X_BUILD_IMPLICIT),0)
ifneq ($(X_NO_INSTALL),1)
  all:: $($(X_MODULE)_BINARY)
  install:: $($(X_MODULE)_BINARY)
	$(Q)for x in $^; do \
	  case $$x in \
		*$(X_DYNEXT) ) echo INSTALL DYNLIB $$x; mkdir -p $(DESTDIR)$(libdir)/; install $$x $(DESTDIR)$(libdir)/ ;; \
		*$(X_LIBEXT) ) ;; \
		*$(X_EXEEXT) ) echo INSTALL EXEC   $$x; mkdir -p $(DESTDIR)$(bindir)/; install $$x $(DESTDIR)$(bindir)/ ;; \
	  esac ;\
	done
endif
endif

$(X_MODULE): $($(X_MODULE)_BINARY)

$($(X_MODULE)_OUTPUT)/%.o: $(X_MODULE)/%.c
	$(Q)$(COMPILE.c) $($(dir $@)CFLAGS) -MMD -MP -MF '$(patsubst %.o,%.d,$@)' -o '$@' '$<'

$($(X_MODULE)_OUTPUT)/%.o: $(X_MODULE)/%.m
	$(Q)$(COMPILE.c) $($(dir $@)CFLAGS) -MMD -MP -MF '$(patsubst %.o,%.d,$@)' -o '$@' '$<'

$($(X_MODULE)_OUTPUT)/%.o: $($(X_MODULE)_OUTPUT)/%.cc
	$(Q)$(COMPILE.cc) $($(dir $@)CXXFLAGS) -MMD -MP -MF '$(patsubst %.o,%.d,$@)' -o '$@' '$<'

$($(X_MODULE)_OUTPUT)/%.o: $(X_MODULE)/%.cc
	$(Q)$(COMPILE.cc) $($(dir $@)CXXFLAGS) -MMD -MP -MF '$(patsubst %.o,%.d,$@)' -o '$@' '$<'

$($(X_MODULE)_OUTPUT)/%.o: $(X_MODULE)/%.mm
	$(Q)$(COMPILE.cc) $($(dir $@)CXXFLAGS) -MMD -MP -MF '$(patsubst %.o,%.d,$@)' -o '$@' '$<'

# only implicit rules if one binary per module ...
ifeq ($(words $(BINARY)), 1)

$($(X_MODULE)_OUTPUT)/$(BINARY)$(X_LIBEXT): $($(X_MODULE)_OBJS)
	$(Q)$(LD) -r -o '$@' $^
#	# no AR anymore due to static initilizers
#	$(Q)$(AR) r '$@' $^ 2> /dev/null
#	$(Q)$(RANLIB) '$@'

$($(X_MODULE)_OUTPUT)/$(BINARY)$(X_DYNEXT): $($(X_MODULE)_OBJS)
	$(Q)$(CXX) $(filter-out -fPIE,$(CXXFLAGS)) $(CPPFLAGS) $(filter-out -fPIE,$($(dir $@)CXXFLAGS)) $(TARGET_ARCH) $(X_DYNFLAGS) -o '$@' $^ $(filter-out -fPIE,$(filter-out -pie,$(LDFLAGS))) $(filter-out -fPIE,$(filter-out -pie,$($(dir $@)LDFLAGS)))

$($(X_MODULE)_OUTPUT)/$(BINARY)$(X_EXEEXT): $($(X_MODULE)_OBJS)
	$(Q)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $($(dir $@)CXXFLAGS) $(TARGET_ARCH) $(X_EXEFLAGS) -o '$@' $^ $(LDFLAGS) $($(dir $@)LDFLAGS)

endif

$($(X_MODULE)_OUTPUT)/%$(X_EXEEXT): $($(X_MODULE)_OUTPUT)/%.o $(DEPS)
	$(Q)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $($(dir $@)CXXFLAGS) $(TARGET_ARCH) $(X_EXEFLAGS) -o '$@' $^ $(LDFLAGS) $($(dir $@)LDFLAGS)