2011-11-21 21:46:03 +01:00
|
|
|
# Makefile for pastebincl (command-line pastebin) by BASTIAN Théophile (aka Tobast)
|
|
|
|
|
2012-01-08 17:48:23 +01:00
|
|
|
ENC_KEY=`python genkey.py`
|
2011-12-19 00:20:16 +01:00
|
|
|
|
2011-11-21 21:46:03 +01:00
|
|
|
CXX=g++
|
|
|
|
CXXFLAGS=-Wall -Werror -O2
|
2011-11-28 22:09:25 +01:00
|
|
|
CXXLIBS=-lcurl
|
2011-11-21 21:46:03 +01:00
|
|
|
TARGET=pastebincl
|
2011-12-19 00:20:16 +01:00
|
|
|
OBJS=CurlPost.o func.o main.o ParameterRead.o ConfigRead.o
|
2011-11-21 21:46:03 +01:00
|
|
|
|
2012-01-08 17:48:23 +01:00
|
|
|
all: inputdevcode checkdevcode $(TARGET)
|
|
|
|
cp $(TARGET) ../
|
2011-12-25 00:48:23 +01:00
|
|
|
|
2012-01-08 17:48:23 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
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
|
2011-12-28 14:08:33 +01:00
|
|
|
|
|
|
|
#### Useful while developping. To enable it, uncomment and add it as a dependence of 'all' ####
|
2012-01-08 17:48:23 +01:00
|
|
|
#makeuser:
|
|
|
|
# ./pastebincl --usergen < userinput &> /dev/null
|
2011-11-21 21:46:03 +01:00
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
$(CXX) $(CXXLIBS) $^ $(CXXFLAGS) -o $@
|
|
|
|
|
2011-12-19 00:20:16 +01:00
|
|
|
ConfigRead.o: ConfigRead.cpp
|
|
|
|
$(CXX) $(CXXLIBS) -c $< $(CXXFLAGS) -o $@ -DENCODING_KEY=\"${ENC_KEY}\"
|
|
|
|
|
2011-11-21 21:46:03 +01:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXXLIBS) -c $< $(CXXFLAGS) -o $@
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
|
|
|
|
mrproper: clean
|
|
|
|
rm -f $(TARGET)
|
|
|
|
|