mirror of
https://github.com/sheumann/hush.git
synced 2024-12-26 10:32:02 +00:00
149 lines
4.0 KiB
Bash
Executable File
149 lines
4.0 KiB
Bash
Executable File
#! /bin/bash
|
||
|
||
###############################################
|
||
### See if we have a Config.h.ORG file ###
|
||
### If not, create it... ###
|
||
###############################################
|
||
if [ ! -e "Config.h.ORG" ]; then
|
||
echo "Creating Config.h.ORG"
|
||
cp Config.h Config.h.ORG
|
||
if [ ! -e "Config.h.ORG" ]; then
|
||
echo "$0: ABORTING: Unable to create Config.h.ORG"
|
||
exit
|
||
fi
|
||
fi
|
||
|
||
###############################################################
|
||
### See if we have a bb.def.h file. If not, extract the ###
|
||
### unchangeable portion of Config.h.ORG into bb.def.h ###
|
||
###############################################################
|
||
if [ ! -e "bb.def.h" ]; then
|
||
echo "Creating bb.def.h"
|
||
POSITION=`grep -n "Nothing beyond this point should ever be touched" \
|
||
Config.h.ORG | cut -d: -f1`
|
||
TOTALLINES=`cat Config.h.ORG | wc -l`
|
||
NUMLINES=$[${TOTALLINES}-${POSITION}+2]
|
||
tail -n ${NUMLINES} Config.h.ORG > bb.def.h
|
||
if [ ! -e "bb.def.h" ]; then
|
||
echo "$0: ABORTING: Unable to create bb.def.h"
|
||
exit
|
||
fi
|
||
fi
|
||
|
||
#####################################################################
|
||
### See if we have a bb.OptionsAndFeatures file. If not, extract ###
|
||
### all the BB_xxx options and features into a unique sorted list ###
|
||
### and stuff them into bb.OptionsAndFeatures. ###
|
||
#####################################################################
|
||
if [ ! -e "bb.OptionsAndFeatures" ]; then
|
||
echo "Creating bb.OptionsAndFeatures"
|
||
grep BB_ *.[ch] \
|
||
| tr ' ,(){}|&' ' |