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
|
2013-02-06 19:56:48 +01:00
|
|
|
MANPAGE=pastebincl.1.gz
|
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)
|
2012-08-21 19:50:31 +02:00
|
|
|
# cp $(TARGET) ../
|
2011-12-25 00:48:23 +01:00
|
|
|
|
2012-01-08 17:48:23 +01:00
|
|
|
inputdevcode:
|
2012-08-21 19:50:31 +02:00
|
|
|
|
|
|
|
@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
|
2012-01-08 17:48:23 +01:00
|
|
|
|
|
|
|
checkdevcode:
|
2012-08-21 19:50:31 +02:00
|
|
|
@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
|
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)
|
2013-02-06 21:10:57 +01:00
|
|
|
$(CXX) $^ $(CXXFLAGS) $(CXXLIBS) -o $@
|
2011-11-21 21:46:03 +01:00
|
|
|
|
2011-12-19 00:20:16 +01:00
|
|
|
ConfigRead.o: ConfigRead.cpp
|
2013-02-06 21:10:57 +01:00
|
|
|
$(CXX) -c $< $(CXXFLAGS) $(CXXLIBS) -o $@ -DENCODING_KEY=\"${ENC_KEY}\"
|
2011-12-19 00:20:16 +01:00
|
|
|
|
2011-11-21 21:46:03 +01:00
|
|
|
%.o: %.cpp
|
2013-02-06 21:10:57 +01:00
|
|
|
$(CXX) -c $< $(CXXLIBS) $(CXXFLAGS) -o $@
|
2011-11-21 21:46:03 +01:00
|
|
|
|
2013-02-06 19:56:48 +01:00
|
|
|
install:
|
|
|
|
cp $(TARGET) /usr/bin
|
|
|
|
cp $(MANPAGE) /usr/share/man/man1/
|
|
|
|
|
2011-11-21 21:46:03 +01:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
|
|
|
|
mrproper: clean
|
|
|
|
rm -f $(TARGET)
|
|
|
|
|