pastebincl/Makefile

50 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

# Makefile for pastebincl (command-line pastebin) by BASTIAN Théophile (aka Tobast)
ENC_KEY=`python genkey.py`
CXX=g++
CXXFLAGS=-Wall -Werror -O2
CXXLIBS=-lcurl
TARGET=pastebincl
MANPAGE=pastebincl.1.gz
OBJS=CurlPost.o func.o main.o ParameterRead.o ConfigRead.o
all: inputdevcode checkdevcode $(TARGET)
# cp $(TARGET) ../
2011-12-25 00:48:23 +01:00
inputdevcode:
@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 ! 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:
# ./pastebincl --usergen < userinput &> /dev/null
$(TARGET): $(OBJS)
2013-02-06 21:10:57 +01:00
$(CXX) $^ $(CXXFLAGS) $(CXXLIBS) -o $@
ConfigRead.o: ConfigRead.cpp
2013-02-06 21:10:57 +01:00
$(CXX) -c $< $(CXXFLAGS) $(CXXLIBS) -o $@ -DENCODING_KEY=\"${ENC_KEY}\"
%.o: %.cpp
2013-02-06 21:10:57 +01:00
$(CXX) -c $< $(CXXLIBS) $(CXXFLAGS) -o $@
install:
cp $(TARGET) /usr/bin
cp $(MANPAGE) /usr/share/man/man1/
.PHONY: clean
clean:
rm -f *.o
mrproper: clean
rm -f $(TARGET)