xref: /aosp_15_r20/external/tinyxml2/Makefile (revision 7485b22521f577cf944e5687361548d8993d8d2c)
1*7485b225SElliott Hughes# For GNU conventions and targets see https://www.gnu.org/prep/standards/standards.html
2*7485b225SElliott Hughes# Using GNU standards makes it easier for some users to keep doing what they are used to.
3*7485b225SElliott Hughes
4*7485b225SElliott Hughes# 'mkdir -p' is non-portable, but it is widely supported. A portable solution
5*7485b225SElliott Hughes# is elusive due to race conditions on testing the directory and creating it.
6*7485b225SElliott Hughes# Anemic toolchain users can sidestep the problem using MKDIR="mkdir".
7*7485b225SElliott Hughes
8*7485b225SElliott HughesAR = ar
9*7485b225SElliott HughesARFLAGS = cr
10*7485b225SElliott HughesRM = rm -f
11*7485b225SElliott HughesRANLIB = ranlib
12*7485b225SElliott HughesMKDIR = mkdir -p
13*7485b225SElliott HughesCXXFLAGS = -D_FILE_OFFSET_BITS=64 -fPIC
14*7485b225SElliott Hughes
15*7485b225SElliott HughesINSTALL = install
16*7485b225SElliott HughesINSTALL_PROGRAM = $(INSTALL)
17*7485b225SElliott HughesINSTALL_DATA = $(INSTALL) -m 644
18*7485b225SElliott Hughes
19*7485b225SElliott Hughesprefix = /usr/local
20*7485b225SElliott Hughesbindir = $(prefix)/bin
21*7485b225SElliott Hugheslibdir = $(prefix)/lib
22*7485b225SElliott Hughesincludedir = $(prefix)/include
23*7485b225SElliott Hughes
24*7485b225SElliott Hughesall: xmltest staticlib
25*7485b225SElliott Hughes
26*7485b225SElliott Hughesrebuild: clean all
27*7485b225SElliott Hughes
28*7485b225SElliott Hughesxmltest: xmltest.cpp libtinyxml2.a
29*7485b225SElliott Hughes
30*7485b225SElliott Hugheseffc:
31*7485b225SElliott Hughes	gcc -Werror -Wall -Wextra -Wshadow -Wpedantic -Wformat-nonliteral \
32*7485b225SElliott Hughes        -Wformat-security -Wswitch-default -Wuninitialized -Wundef \
33*7485b225SElliott Hughes        -Wpointer-arith -Woverloaded-virtual -Wctor-dtor-privacy \
34*7485b225SElliott Hughes        -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo \
35*7485b225SElliott Hughes        -Wno-unused-parameter -Weffc++ xmltest.cpp tinyxml2.cpp -o xmltest
36*7485b225SElliott Hughes
37*7485b225SElliott Hughesclean:
38*7485b225SElliott Hughes	-$(RM) *.o xmltest libtinyxml2.a
39*7485b225SElliott Hughes
40*7485b225SElliott Hughes# Standard GNU target
41*7485b225SElliott Hughesdistclean:
42*7485b225SElliott Hughes	-$(RM) *.o xmltest libtinyxml2.a
43*7485b225SElliott Hughes
44*7485b225SElliott Hughestest: xmltest
45*7485b225SElliott Hughes	./xmltest
46*7485b225SElliott Hughes
47*7485b225SElliott Hughes# Standard GNU target
48*7485b225SElliott Hughescheck: xmltest
49*7485b225SElliott Hughes	./xmltest
50*7485b225SElliott Hughes
51*7485b225SElliott Hughesstaticlib: libtinyxml2.a
52*7485b225SElliott Hughes
53*7485b225SElliott Hugheslibtinyxml2.a: tinyxml2.o
54*7485b225SElliott Hughes	$(AR) $(ARFLAGS) $@ $^
55*7485b225SElliott Hughes	$(RANLIB) $@
56*7485b225SElliott Hughes
57*7485b225SElliott Hughestinyxml2.o: tinyxml2.cpp tinyxml2.h
58*7485b225SElliott Hughes
59*7485b225SElliott Hughesdirectories:
60*7485b225SElliott Hughes	$(MKDIR) $(DESTDIR)$(prefix)
61*7485b225SElliott Hughes	$(MKDIR) $(DESTDIR)$(bindir)
62*7485b225SElliott Hughes	$(MKDIR) $(DESTDIR)$(libdir)
63*7485b225SElliott Hughes	$(MKDIR) $(DESTDIR)$(includedir)
64*7485b225SElliott Hughes
65*7485b225SElliott Hughes# Standard GNU target.
66*7485b225SElliott Hughesinstall: xmltest staticlib directories
67*7485b225SElliott Hughes	$(INSTALL_PROGRAM) xmltest $(DESTDIR)$(bindir)/xmltest
68*7485b225SElliott Hughes	$(INSTALL_DATA) tinyxml2.h $(DESTDIR)$(includedir)/tinyxml2.h
69*7485b225SElliott Hughes	$(INSTALL_DATA) libtinyxml2.a $(DESTDIR)$(libdir)/libtinyxml2.a
70*7485b225SElliott Hughes
71*7485b225SElliott Hughes# Standard GNU target
72*7485b225SElliott Hughesuninstall:
73*7485b225SElliott Hughes	$(RM) $(DESTDIR)$(bindir)/xmltest
74*7485b225SElliott Hughes	$(RM) $(DESTDIR)$(includedir)/tinyxml2.h
75*7485b225SElliott Hughes	$(RM) $(DESTDIR)$(libdir)/libtinyxml2.a
76