Makefile.linux-generic 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/usr/make
  2. all:
  3. #
  4. # Makefile for SQLITE
  5. #
  6. # This is a template makefile for SQLite. Most people prefer to
  7. # use the autoconf generated "configure" script to generate the
  8. # makefile automatically. But that does not work for everybody
  9. # and in every situation. If you are having problems with the
  10. # "configure" script, you might want to try this makefile as an
  11. # alternative. Create a copy of this file, edit the parameters
  12. # below and type "make".
  13. #
  14. # Maintenance note: because this is the template for Linux systems, it
  15. # is assumed that the platform has GNU make and this file takes
  16. # advantage of that.
  17. #
  18. ####
  19. #
  20. # $(TOP) = The toplevel directory of the source tree. This is the
  21. # directory that contains "Makefile.in" and "auto.def".
  22. #
  23. TOP ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
  24. #
  25. # $(CFLAGS) will be used when compiling the library and most
  26. # utilities. It must normally contain -fPIC on Linux systems,
  27. # but overriding CFLAGS is an easy way for users to inadvertently
  28. # remove -fPIC from their builds, so we generally expect to see
  29. # -fPIC in $(CFLAGS.core), which main.mk will integrate with
  30. # the CFLAGS where needed.
  31. #
  32. CFLAGS =
  33. CFLAGS.core = -fPIC
  34. #
  35. # $(SHELL_OPT) contains CFLAGS for building the sqlite3 CLI shell.
  36. # See main.mk for other potentially-relevant vars which may need
  37. # tweaking, like $(LDFLAGS_READLINE).
  38. #
  39. SHELL_OPT += -DHAVE_READLINE=1
  40. SHELL_OPT += -DSQLITE_HAVE_ZLIB=1
  41. LDFLAGS.readline = -lreadline # may need -lcurses etc, depending on the system
  42. CFLAGS.readline = # needs -I... if readline.h is in an unusual place.
  43. LDFLAGS.zlib = -lz
  44. #
  45. # Library's version number.
  46. #
  47. PACKAGE_VERSION ?= $(shell cat $(TOP)/VERSION 2>/dev/null)
  48. # sqlite_cfg.h is typically created by the configure script. It's
  49. # commonly not needed but main.mk does not know that so we have to
  50. # create a dummy if we don't already have one.
  51. sqlite_cfg.h:
  52. touch $@
  53. distclean-.:
  54. rm -f sqlite_cfg.h
  55. #
  56. # With the above in place, we can now import the rules make use of
  57. # it...
  58. #
  59. include $(TOP)/main.mk