#!/bin/bash
#
# Creates libdevpart.comp by concatenating code areas from 
# devpart *.comp files
#
args=("$@")
lastarg="${args[-1]}"
unset args[-1]

# Truncate
> $lastarg

for file in "${args[@]}"; do
    awk '
    found { print }
    /\/\* <libdevpart\.comp> \*\// { found = 1 }
    ' "$file" >> $lastarg
done