mirror of https://github.com/bqv/weechat-xmpp
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
758 B
Makefile
25 lines
758 B
Makefile
2 years ago
|
#!/usr/bin/env -S gmake depend
|
||
|
# vim: set noexpandtab:
|
||
|
|
||
|
.PHONY: depend
|
||
|
depend: $(DEPS) $(SRCS) $(HDRS)
|
||
|
echo > ./.depend
|
||
|
for src in $(SRCS) tests/main.cc; do \
|
||
|
dir="$$(dirname $$src)"; \
|
||
|
src="$$(basename $$src)"; \
|
||
|
if [[ $$src == *.cpp ]]; then \
|
||
|
echo "g++ $(CPPFLAGS) -MM -MMD -MP -MF - \
|
||
|
-MT $$dir/.$${src/.cpp/.o} $$dir/$$src >> ./.depend"; \
|
||
|
g++ $(CPPFLAGS) -MM -MMD -MP -MF - \
|
||
|
-MT $$dir/.$${src/.cpp/.o} $$dir/$$src >> ./.depend || true ; \
|
||
|
elif [[ $$src == *.c ]]; then \
|
||
|
echo "gcc $(CFLAGS) -MM -MMD -MP -MF - \
|
||
|
-MT $$dir/.$${src/.c/.o} $$dir/$$src >> ./.depend"; \
|
||
|
gcc $(CFLAGS) -MM -MMD -MP -MF - \
|
||
|
-MT $$dir/.$${src/.c/.o} $$dir/$$src >> ./.depend || true ; \
|
||
|
else continue; \
|
||
|
fi; \
|
||
|
done
|
||
|
|
||
|
include .depend
|