#!/bin/bash

# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
#
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
#
# This software may be modified and distributed under the terms of
# the 3-Clause BSD License. See the LICENSE file in the package base
# directory for details.


# create or clear content of old file mapping
> FileMapping.txt

# source directory
DIR=$(pwd)

# list of all source files
SRC=$(find $DIR -type f -regextype posix-extended -regex ".*/[^.][^/]+\.(c|cc|cpp|h|hpp|ipp)" | sort)

# index variable for source files
declare -i index=1

for f in $SRC
do
        echo -e "$index\t$f" >> FileMapping.txt
        index+=1
done
