3 # ----------------------------- #
11 # ---------------------------------------------------------------------------------------------------------------------
13 BUILD_CXX_FLAGS
+= -I..
17 BUILD_CXX_FLAGS
+= -pthread
21 # ---------------------------------------------------------------------------------------------------------------------
23 OBJS
= $(OBJDIR
)/$(MODULENAME
).
cpp.o
24 OBJS_files
= $(OBJDIR
)/$(MODULENAME
).
cpp.files.o
25 OBJS_arm32
= $(OBJDIR
)/$(MODULENAME
).
cpp.arm32.o
26 OBJS_posix32
= $(OBJDIR
)/$(MODULENAME
).
cpp.posix32.o
27 OBJS_posix64
= $(OBJDIR
)/$(MODULENAME
).
cpp.posix64.o
28 OBJS_win32
= $(OBJDIR
)/$(MODULENAME
).
cpp.win32.o
29 OBJS_win64
= $(OBJDIR
)/$(MODULENAME
).
cpp.win64.o
31 # ---------------------------------------------------------------------------------------------------------------------
33 all: $(MODULEDIR
)/$(MODULENAME
).a
$(MODULEDIR
)/$(MODULENAME
).files.a
34 files
: $(MODULEDIR
)/$(MODULENAME
).files.a
35 arm32
: $(MODULEDIR
)/$(MODULENAME
).arm32.a
36 posix32
: $(MODULEDIR
)/$(MODULENAME
).posix32.a
37 posix64
: $(MODULEDIR
)/$(MODULENAME
).posix64.a
38 win32
: $(MODULEDIR
)/$(MODULENAME
).win32.a
39 win64
: $(MODULEDIR
)/$(MODULENAME
).win64.a
41 # ---------------------------------------------------------------------------------------------------------------------
44 rm -f
$(OBJDIR
)/*.o
$(MODULEDIR
)/$(MODULENAME
)*.a
49 # ---------------------------------------------------------------------------------------------------------------------
51 $(MODULEDIR
)/$(MODULENAME
).a
: $(OBJS
)
52 -@mkdir
-p
$(MODULEDIR
)
53 @echo
"Creating $(MODULENAME).a"
55 $(SILENT
)$(AR
) crs
$@
$^
57 $(MODULEDIR
)/$(MODULENAME
).files.a
: $(OBJS_files
)
58 -@mkdir
-p
$(MODULEDIR
)
59 @echo
"Creating $(MODULENAME).files.a"
61 $(SILENT
)$(AR
) crs
$@
$^
63 $(MODULEDIR
)/$(MODULENAME
).arm32.a
: $(OBJS_arm32
)
64 -@mkdir
-p
$(MODULEDIR
)
65 @echo
"Creating $(MODULENAME).arm32.a"
67 $(SILENT
)$(AR
) crs
$@
$^
69 $(MODULEDIR
)/$(MODULENAME
).posix32.a
: $(OBJS_posix32
)
70 -@mkdir
-p
$(MODULEDIR
)
71 @echo
"Creating $(MODULENAME).posix32.a"
73 $(SILENT
)$(AR
) crs
$@
$^
75 $(MODULEDIR
)/$(MODULENAME
).posix64.a
: $(OBJS_posix64
)
76 -@mkdir
-p
$(MODULEDIR
)
77 @echo
"Creating $(MODULENAME).posix64.a"
79 $(SILENT
)$(AR
) crs
$@
$^
81 $(MODULEDIR
)/$(MODULENAME
).win32.a
: $(OBJS_win32
)
82 -@mkdir
-p
$(MODULEDIR
)
83 @echo
"Creating $(MODULENAME).win32.a"
85 $(SILENT
)$(AR
) crs
$@
$^
87 $(MODULEDIR
)/$(MODULENAME
).win64.a
: $(OBJS_win64
)
88 -@mkdir
-p
$(MODULEDIR
)
89 @echo
"Creating $(MODULENAME).win64.a"
91 $(SILENT
)$(AR
) crs
$@
$^
93 # ---------------------------------------------------------------------------------------------------------------------
95 $(OBJDIR
)/$(MODULENAME
).
cpp.o
: $(MODULENAME
).
cpp
98 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) -c
-o
$@
100 $(OBJDIR
)/$(MODULENAME
).
cpp.files.o
: $(MODULENAME
).files.
cpp
103 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) -c
-o
$@
105 $(OBJDIR
)/$(MODULENAME
).
cpp.
%32.o
: $(MODULENAME
).
cpp
107 @echo
"Compiling $< (32bit)"
108 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(32BIT_FLAGS
) -c
-o
$@
110 $(OBJDIR
)/$(MODULENAME
).
cpp.
%64.o
: $(MODULENAME
).
cpp
112 @echo
"Compiling $< (64bit)"
113 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(64BIT_FLAGS
) -c
-o
$@
115 $(OBJDIR
)/$(MODULENAME
).
cpp.arm32.o
: $(MODULENAME
).
cpp
117 @echo
"Compiling $< (ARM32)"
118 $(SILENT
)$(CXX
) $< $(BUILD_CXX_FLAGS
) $(ARM32_FLAGS
) -c
-o
$@
121 $(OBJDIR
)/$(MODULENAME
).
cpp.o
: BUILD_CXX_FLAGS
+= -ObjC
++
122 $(OBJDIR
)/$(MODULENAME
).
cpp.files.o
: BUILD_CXX_FLAGS
+= -ObjC
++
123 $(OBJDIR
)/$(MODULENAME
).
cpp.
%32.o
: BUILD_CXX_FLAGS
+= -ObjC
++
124 $(OBJDIR
)/$(MODULENAME
).
cpp.
%64.o
: BUILD_CXX_FLAGS
+= -ObjC
++
127 # ---------------------------------------------------------------------------------------------------------------------
129 -include $(OBJS
:%.o
=%.d
)
130 -include $(OBJS_files
:%.o
=%.d
)
131 -include $(OBJS_arm32
:%.o
=%.d
)
132 -include $(OBJS_posix32
:%.o
=%.d
)
133 -include $(OBJS_posix64
:%.o
=%.d
)
134 -include $(OBJS_win32
:%.o
=%.d
)
135 -include $(OBJS_win64
:%.o
=%.d
)
137 # ---------------------------------------------------------------------------------------------------------------------