1#==================================================================================================
2#
3#  Makefile for the smatreduce/columnwise module of the Blaze test suite
4#
5#  Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved - All Rights Reserved
6#
7#  This file is part of the Blaze library. You can redistribute it and/or modify it under
8#  the terms of the New (Revised) BSD License. Redistribution and use in source and binary
9#  forms, with or without modification, are permitted provided that the following conditions
10#  are met:
11#
12#  1. Redistributions of source code must retain the above copyright notice, this list of
13#     conditions and the following disclaimer.
14#  2. Redistributions in binary form must reproduce the above copyright notice, this list
15#     of conditions and the following disclaimer in the documentation and/or other materials
16#     provided with the distribution.
17#  3. Neither the names of the Blaze development group nor the names of its contributors
18#     may be used to endorse or promote products derived from this software without specific
19#     prior written permission.
20#
21#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
22#  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23#  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
24#  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25#  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26#  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27#  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29#  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
30#  DAMAGE.
31#
32#==================================================================================================
33
34
35# Including the compiler and library settings
36ifneq ($(MAKECMDGOALS),reset)
37ifneq ($(MAKECMDGOALS),clean)
38-include ../../../../Makeconfig
39endif
40endif
41
42
43# Setting the source, object and dependency files
44SRC = $(wildcard ./*.cpp)
45DEP = $(SRC:.cpp=.d)
46OBJ = $(SRC:.cpp=.o)
47BIN = $(SRC:.cpp=)
48
49
50# General rules
51default: $(BIN)
52all: $(BIN)
53essential: MCa SCa HCa LCa UCa DCa
54single: MCa
55
56
57# Build rules
58DCa: DCa.o
59	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
60DCb: DCb.o
61	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
62
63HCa: HCa.o
64	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
65HCb: HCb.o
66	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
67
68LCa: LCa.o
69	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
70LCb: LCb.o
71	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
72
73MCa: MCa.o
74	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
75MCb: MCb.o
76	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
77
78MIa: MIa.o
79	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
80MIb: MIb.o
81	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
82
83MZa: MZa.o
84	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
85MZb: MZb.o
86	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
87
88SCa: SCa.o
89	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
90SCb: SCb.o
91	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
92
93UCa: UCa.o
94	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
95UCb: UCb.o
96	@$(CXX) $(CXXFLAGS) -o $@ $< $(LIBRARIES)
97
98
99# Cleanup
100reset:
101	@$(RM) $(OBJ) $(BIN)
102clean:
103	@$(RM) $(OBJ) $(BIN) $(DEP)
104
105
106# Makefile includes
107ifneq ($(MAKECMDGOALS),reset)
108ifneq ($(MAKECMDGOALS),clean)
109-include $(DEP)
110endif
111endif
112
113
114# Makefile generation
115%.d: %.cpp
116	@$(CXX) -MM -MP -MT "$*.o $*.d" -MF $@ $(CXXFLAGS) $<
117
118
119# Setting the independent commands
120.PHONY: default all essential single reset clean
121