Modified Makefile & input_devcode for compatibility

This commit is contained in:
tobast 2012-08-21 19:50:31 +02:00
parent c9ac1b511d
commit 37c8131ce1
2 changed files with 8 additions and 6 deletions

View File

@ -9,15 +9,16 @@ TARGET=pastebincl
OBJS=CurlPost.o func.o main.o ParameterRead.o ConfigRead.o
all: inputdevcode checkdevcode $(TARGET)
cp $(TARGET) ../
# cp $(TARGET) ../
inputdevcode:
@if [[ ! -f data_devcode.h ]]; then cp data_devcode_default.h data_devcode.h; fi
@if (( `cat data_devcode.h | grep -c '#define DEVELOPPER_CODE ""'` != 0 )); then echo -e "\n" ; bash input_devcode.sh; fi
@if ! test -f data_devcode.h; then cp data_devcode_default.h data_devcode.h; fi
@if test `cat data_devcode.h | grep -c '#define DEVELOPPER_CODE ""'` -gt 0 ; then echo -e "\n" ; /bin/bash input_devcode.sh; fi
checkdevcode:
@if [[ ! -f data_devcode.h ]]; then echo -e "\nERROR: No 'data_devcode.h' file (common error). Please read \"COMPILE.txt\" for more help.\n" ; false ; fi
@if (( `cat data_devcode.h | grep -c '#define DEVELOPPER_CODE ""'` != 0 )); then echo -e "\nERROR: 'DEVELOPPER_CODE' undefined (common error). Please read \"COMPILE.txt\" for more help.\n" ; false ; fi
@if ! test -f data_devcode.h ; then echo -e "\nERROR: No 'data_devcode.h' file (common error). Please read \"COMPILE.txt\" for more help.\n" ; false ; fi
@if test `cat data_devcode.h | grep -c '#define DEVELOPPER_CODE ""'` -gt 0 ; then echo -e "\nERROR: 'DEVELOPPER_CODE' undefined (common error). Please read \"COMPILE.txt\" for more help.\n" ; false ; fi
#### Useful while developping. To enable it, uncomment and add it as a dependence of 'all' ####
#makeuser:

View File

@ -23,6 +23,7 @@ while true; do
fi
done
sed -ire "49s/\"\".*$/\"${input}\"/" data_devcode.h
sed -i "s/\(#define DEVELOPPER_CODE \)\"\"/\1\"${input}\"/" data_devcode.h
#sed -ire "49s/\"\".*$/\"${input}\"/" data_devcode.h
echo "Success!"