#!/bin/sh

# temporary solution until we switch over to scconfig

RT="$1"

echo '
# Autogenerated - DO NOT EDIT

include ../Makefile.conf
include $(LIBRND_PREFIX)/share/librnd3/librnd.mak
CFLAGS = -Wall -g -I. -I../src_3rd $(CFLAGS_LIBRND) -isystem '$RT'/include/librnd/src_3rd

all:
	echo "### Generated file, do not edit, run make dep ###" > Makefile.dep
	echo "" >> Makefile.dep' > Makefile.depgen

for fn in *.c
do
	echo "	gcc -MM $fn \$(CFLAGS) >> Makefile.dep " >> Makefile.depgen
done

for fn in ../src_plugins/*/*.c
do
	base=${fn%%.c}
	fnt=$base.o
	echo "	gcc -MT $fnt -MM $fn \$(CFLAGS) >> Makefile.dep " >> Makefile.depgen
done
