suikan4github / murasaki

STM32 HAL class library
MIT License
18 stars 3 forks source link

Update install script #78

Closed suikan4github closed 4 years ago

suikan4github commented 4 years ago

Describe the bug To support the "Advanced" Project Structure, we need to change the installer.

In the advanced structure, the Inc/Src are under

Need to fix. basic structure advanced structure

suikan4github commented 4 years ago

The following commands set the Source Directory and Inc Directory to $SRCDIR and $INCDIR variable, respectively.

SRCDIR=$(dirname `find .. -name main.c`)
INCDIR=$(dirname `find .. -name main.h`)
suikan4github commented 4 years ago
SRCDIRNUM=$(dirname `find .. -name main.c` | wc -l )
INCDIRNUM=$(dirname `find .. -name main.h` | wc -l )

if [ $INCDIRNUM .lt "1" ] ; then
  echo "The main.h is not found. Process aborting"
  exit
fi
if [ $INCDIRNUM .gt "1" ] ; then
  echo "Too many main.h are found. Process aborting"
  exit
fi

if [ $SRCDIRNUM .lt "1" ] ; then
  echo "The main.c is not found. Process aborting"
  exit
fi
if [ $SRCDIRNUM .gt "1" ] ; then
  echo "Too many main.c are found. Process aborting"
  exit
fi

SRCDIR=$(dirname `find .. -name main.c`)
INCDIR=$(dirname `find .. -name main.h`)
suikan4github commented 4 years ago

Merged to develop. Ready to release.