18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ciPREFIX		?= /usr
38c2ecf20Sopenharmony_ciDESTDIR		?=
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciall:
68c2ecf20Sopenharmony_ci	@echo "Nothing to build"
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciinstall : uninstall
98c2ecf20Sopenharmony_ci	install -d  $(DESTDIR)$(PREFIX)/lib/pm-graph
108c2ecf20Sopenharmony_ci	install sleepgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph
118c2ecf20Sopenharmony_ci	install bootgraph.py $(DESTDIR)$(PREFIX)/lib/pm-graph
128c2ecf20Sopenharmony_ci	install -d  $(DESTDIR)$(PREFIX)/lib/pm-graph/config
138c2ecf20Sopenharmony_ci	install -m 644 config/cgskip.txt $(DESTDIR)$(PREFIX)/lib/pm-graph/config
148c2ecf20Sopenharmony_ci	install -m 644 config/freeze-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
158c2ecf20Sopenharmony_ci	install -m 644 config/freeze.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
168c2ecf20Sopenharmony_ci	install -m 644 config/freeze-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
178c2ecf20Sopenharmony_ci	install -m 644 config/standby-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
188c2ecf20Sopenharmony_ci	install -m 644 config/standby.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
198c2ecf20Sopenharmony_ci	install -m 644 config/standby-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
208c2ecf20Sopenharmony_ci	install -m 644 config/suspend-callgraph.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
218c2ecf20Sopenharmony_ci	install -m 644 config/suspend.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
228c2ecf20Sopenharmony_ci	install -m 644 config/suspend-dev.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
238c2ecf20Sopenharmony_ci	install -m 644 config/suspend-x2-proc.cfg $(DESTDIR)$(PREFIX)/lib/pm-graph/config
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci	install -d  $(DESTDIR)$(PREFIX)/bin
268c2ecf20Sopenharmony_ci	ln -s ../lib/pm-graph/bootgraph.py $(DESTDIR)$(PREFIX)/bin/bootgraph
278c2ecf20Sopenharmony_ci	ln -s ../lib/pm-graph/sleepgraph.py $(DESTDIR)$(PREFIX)/bin/sleepgraph
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	install -d  $(DESTDIR)$(PREFIX)/share/man/man8
308c2ecf20Sopenharmony_ci	install bootgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8
318c2ecf20Sopenharmony_ci	install sleepgraph.8 $(DESTDIR)$(PREFIX)/share/man/man8
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciuninstall :
348c2ecf20Sopenharmony_ci	rm -f $(DESTDIR)$(PREFIX)/share/man/man8/bootgraph.8
358c2ecf20Sopenharmony_ci	rm -f $(DESTDIR)$(PREFIX)/share/man/man8/sleepgraph.8
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci	rm -f $(DESTDIR)$(PREFIX)/bin/bootgraph
388c2ecf20Sopenharmony_ci	rm -f $(DESTDIR)$(PREFIX)/bin/sleepgraph
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/config/*
418c2ecf20Sopenharmony_ci	if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph/config ] ; then \
428c2ecf20Sopenharmony_ci		rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph/config; \
438c2ecf20Sopenharmony_ci	fi;
448c2ecf20Sopenharmony_ci	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/__pycache__/*
458c2ecf20Sopenharmony_ci	if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph/__pycache__ ] ; then \
468c2ecf20Sopenharmony_ci		rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph/__pycache__; \
478c2ecf20Sopenharmony_ci	fi;
488c2ecf20Sopenharmony_ci	rm -f $(DESTDIR)$(PREFIX)/lib/pm-graph/*
498c2ecf20Sopenharmony_ci	if [ -d $(DESTDIR)$(PREFIX)/lib/pm-graph ] ; then \
508c2ecf20Sopenharmony_ci		rmdir $(DESTDIR)$(PREFIX)/lib/pm-graph; \
518c2ecf20Sopenharmony_ci	fi;
52