Posted to bradipo by Bradipo at Wed Mar 10 01:11:03 GMT 2021view raw

  1. $ cat haspledge.h
  2. cat: haspledge.h: No such file or directory
  3. $ make
  4. ( ( cc -c trypledge.c && cc -s -o trypledge trypledge.o ) >/dev/null 2>&1 && echo \#define HASPLEDGE 1 || exit 0 ) > haspledge.h
  5. rm -f trypledge.o trypledge
  6. $ cat haspledge.h
  7. #define HASPLEDGE 1
  8.  
  9. $ cat Makefile
  10. haspledge.h: trypledge.c
  11. ( ( cc -c trypledge.c && cc -s -o trypledge trypledge.o ) >/dev/null \
  12. 2>&1 \
  13. && echo \#define HASPLEDGE 1 || exit 0 ) > haspledge.h
  14. rm -f trypledge.o trypledge
  15.  
  16. $ cat trypledge.c
  17. #include <unistd.h>
  18.  
  19. int main()
  20. {
  21. pledge("stdio",0);
  22. }
  23.