SHARE
TWEET

c@rl@

a guest Feb 7th, 2019 64 in 201 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Makefile for pastebincl (command-line pastebin) by BASTIAN Théophile (aka Tobast)
  2.  
  3. ENC_KEY=`python genkey.py`
  4.  
  5. CXX=g++
  6. CXXFLAGS=-Wall -Werror -O2
  7. CXXLIBS=-lcurl
  8. TARGET=pastebincl
  9. OBJS=CurlPost.o func.o main.o ParameterRead.o ConfigRead.o
  10.  
  11. all: inputdevcode checkdevcode $(TARGET)
  12.     cp $(TARGET) ../
  13.  
  14. inputdevcode:
  15.     @if [[ ! -f data_devcode.h ]]; then cp data_devcode_default.h data_devcode.h; fi
  16.     @if (( `cat data_devcode.h | grep -c '#define DEVELOPPER_CODE ""'` != 0 )); then echo -e "\n" ; bash input_devcode.sh; fi
  17.  
  18. checkdevcode:
  19.     @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
  20.     @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
  21.  
  22. #### Useful while developping. To enable it, uncomment and add it as a dependence of 'all' ####
  23. #makeuser:
  24. #   ./pastebincl --usergen < userinput &> /dev/null
  25.  
  26. $(TARGET): $(OBJS)
  27.     $(CXX) $(CXXLIBS) $^ $(CXXFLAGS) -o $@
  28.  
  29. ConfigRead.o: ConfigRead.cpp
  30.     $(CXX) $(CXXLIBS) -c $< $(CXXFLAGS) -o $@ -DENCODING_KEY=\"${ENC_KEY}\"
  31.  
  32. %.o: %.cpp
  33.     $(CXX) $(CXXLIBS) -c $< $(CXXFLAGS) -o $@
  34.  
  35.  
  36. .PHONY: clean
  37.  
  38. clean:
  39.     rm -f *.o
  40.  
  41. mrproper: clean
  42.     rm -f $(TARGET)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top