patch-Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. - allow for passing custom compiler FLAGS
  2. - use host CC and CFLAGS for tools/configurator build
  3. --- stats-82bd4977b607b8714f361467e37a9d801ff911b6.orig/Makefile 2015-02-27 18:30:06.000000000 +0100
  4. +++ stats-82bd4977b607b8714f361467e37a9d801ff911b6/Makefile 2015-02-27 18:37:14.000000000 +0100
  5. @@ -1,14 +1,15 @@
  6. # Destination directory for installation (intended for packagers)
  7. DESTDIR =
  8. -PREFIX = /usr/local
  9. +PREFIX = /usr
  10. +CC ?=
  11. OPTFLAGS=-O3 -flto
  12. #OPTFLAGS=-g
  13. WARNFLAGS=-Wall -Wstrict-prototypes -Wundef
  14. -CPPFLAGS=-I.
  15. -CFLAGS=$(OPTFLAGS) $(WARNFLAGS)
  16. -LDFLAGS=$(OPTFLAGS)
  17. -LDLIBS=-lm
  18. +CPPFLAGS+=-I.
  19. +CFLAGS+=$(WARNFLAGS)
  20. +LDFLAGS+=
  21. +LDLIBS+=-lm
  22. # Comment this out (or use "VALGRIND=" on cmdline) if you don't have valgrind.
  23. VALGRIND=valgrind --quiet --leak-check=full --error-exitcode=5
  24. @@ -41,6 +42,9 @@ $(OFILES): config.h
  25. config.h: tools/configurator
  26. if $< > $@.tmp; then mv $@.tmp $@; else rm -f $@.tmp; fi
  27. +tools/configurator: CC=${CC_FOR_BUILD}
  28. +tools/configurator: CFLAGS=${CFLAGS_FOR_BUILD}
  29. +tools/configurator: LDFLAGS=${LDFLAGS_FOR_BUILD}
  30. stats: $(OFILES)
  31. distclean: clean