d7534e590c6949bd899c9a0d05f1dfd8a612e504
[reactos.git] / reactos / tools / rbuild / rbuild.mak
1 RBUILD_BASE = .$(SEP)tools$(SEP)rbuild
2
3 RBUILD_TARGET = \
4 $(ROS_INTERMEDIATE)$(RBUILD_BASE)$(SEP)rbuild$(EXEPOSTFIX)
5
6 RBUILD_TEST_TARGET = \
7 $(ROS_INTERMEDIATE)$(RBUILD_BASE)$(SEP)rbuild_test$(EXEPOSTFIX)
8
9 RBUILD_BACKEND_MINGW_BASE_SOURCES = \
10 backend$(SEP)mingw$(SEP)mingw.cpp \
11 backend$(SEP)mingw$(SEP)modulehandler.cpp
12
13 RBUILD_BACKEND_DEVCPP_BASE_SOURCES = \
14 backend$(SEP)devcpp$(SEP)devcpp.cpp
15
16 RBUILD_BACKEND_BASE_SOURCES = \
17 $(RBUILD_BACKEND_MINGW_BASE_SOURCES) \
18 $(RBUILD_BACKEND_DEVCPP_BASE_SOURCES) \
19 backend$(SEP)backend.cpp
20
21 RBUILD_BASE_SOURCES = \
22 $(RBUILD_BACKEND_BASE_SOURCES) \
23 automaticdependency.cpp \
24 bootstrap.cpp \
25 cdfile.cpp \
26 compilerflag.cpp \
27 define.cpp \
28 exception.cpp \
29 include.cpp \
30 linkerflag.cpp \
31 module.cpp \
32 project.cpp \
33 ssprintf.cpp \
34 XML.cpp
35
36 RBUILD_COMMON_SOURCES = \
37 $(addprefix $(RBUILD_BASE)$(SEP), $(RBUILD_BASE_SOURCES)) \
38
39 RBUILD_SPECIAL_SOURCES = \
40 $(RBUILD_BASE)$(SEP)rbuild.cpp
41
42 RBUILD_SOURCES = \
43 $(RBUILD_COMMON_SOURCES) \
44 $(RBUILD_SPECIAL_SOURCES)
45
46 RBUILD_COMMON_OBJECTS = \
47 $(addprefix $(ROS_INTERMEDIATE), $(RBUILD_COMMON_SOURCES:.cpp=.o))
48
49 RBUILD_SPECIAL_OBJECTS = \
50 $(addprefix $(ROS_INTERMEDIATE), $(RBUILD_SPECIAL_SOURCES:.cpp=.o))
51
52 RBUILD_OBJECTS = \
53 $(RBUILD_COMMON_OBJECTS) \
54 $(RBUILD_SPECIAL_OBJECTS)
55
56 RBUILD_TESTS = \
57 tests$(SEP)definetest.cpp \
58 tests$(SEP)functiontest.cpp \
59 tests$(SEP)iftest.cpp \
60 tests$(SEP)includetest.cpp \
61 tests$(SEP)invoketest.cpp \
62 tests$(SEP)linkerflagtest.cpp \
63 tests$(SEP)moduletest.cpp \
64 tests$(SEP)projecttest.cpp \
65 tests$(SEP)sourcefiletest.cpp \
66 tests$(SEP)cdfiletest.cpp
67
68 RBUILD_TEST_SPECIAL_SOURCES = \
69 $(addprefix $(RBUILD_BASE)$(SEP), $(RBUILD_TESTS)) \
70 $(RBUILD_BASE)$(SEP)tests$(SEP)alltests.cpp
71
72 RBUILD_TEST_SOURCES = \
73 $(RBUILD_COMMON_SOURCES) \
74 $(RBUILD_TEST_SPECIAL_SOURCES)
75
76 RBUILD_TEST_SPECIAL_OBJECTS = \
77 $(addprefix $(ROS_INTERMEDIATE), $(RBUILD_TEST_SPECIAL_SOURCES:.cpp=.o))
78
79 RBUILD_TEST_OBJECTS = \
80 $(RBUILD_COMMON_OBJECTS) \
81 $(RBUILD_TEST_SPECIAL_OBJECTS)
82
83 RBUILD_HOST_CXXFLAGS = -g -I$(RBUILD_BASE) -Werror -Wall
84
85 RBUILD_HOST_LFLAGS = -g
86
87 $(RBUILD_TARGET): $(RBUILD_OBJECTS)
88 $(ECHO_LD)
89 ${host_gpp} $(RBUILD_OBJECTS) $(RBUILD_HOST_LFLAGS) -o $(RBUILD_TARGET)
90
91 $(RBUILD_COMMON_OBJECTS): %.o: %.cpp
92 $(ECHO_CC)
93 ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
94
95 $(RBUILD_SPECIAL_OBJECTS): %.o: %.cpp
96 $(ECHO_CC)
97 ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
98
99 $(RBUILD_TEST_TARGET): $(RBUILD_TEST_OBJECTS)
100 $(ECHO_LD)
101 ${host_gpp} $(RBUILD_TEST_OBJECTS) $(RBUILD_HOST_LFLAGS) -o $(RBUILD_TEST_TARGET)
102
103 $(RBUILD_TEST_SPECIAL_OBJECTS): %.o: %.cpp
104 $(ECHO_CC)
105 ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
106
107 .PHONY: rbuild_test
108
109 rbuild_test: $(RBUILD_TEST_TARGET)
110 $(ECHO_TEST)
111 $(Q)$(RBUILD_TEST_TARGET)
112
113 .PHONY: rbuild_clean
114 rbuild_clean:
115 -@$(rm) $(RBUILD_TARGET) $(RBUILD_OBJECTS) $(RBUILD_TEST_TARGET) $(RBUILD_TEST_OBJECTS) 2>$(NUL)
116 clean: rbuild_clean