gen-makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. echo Generating src/Makefile.am ...
  3. cd src
  4. inc_current='$(srcdir)'
  5. inc_modules="$inc_current/modules"
  6. inc_libraries="$inc_current/libraries"
  7. cat > Makefile.am << EOF
  8. AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries -I$inc_libraries/enet/libenet/include \$(LOVE_INCLUDES) \$(FILE_OFFSET)
  9. AM_CXXFLAGS = \$(SDL_CFLAGS)
  10. AUTOMAKE_OPTIONS = subdir-objects
  11. SUBDIRS =
  12. if LOVE_BUILD_EXE
  13. # LÖVE executable
  14. bin_PROGRAMS = love
  15. #love_LDFLAGS =
  16. love_LDADD = liblove.la
  17. love_SOURCES = love.cpp
  18. endif
  19. # Compile scripts
  20. #scripts/%.lua.h: scripts/%.lua
  21. # cd scripts; \
  22. # lua auto.lua \$*
  23. #TODO: Figure out how to only do this on gnu make, and detect which lua
  24. # executable to run
  25. # libLÖVE
  26. lib_LTLIBRARIES = liblove.la
  27. liblove_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS) \$(SDL_LIBS)
  28. liblove_la_SOURCES = \\
  29. EOF
  30. find . \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) \) -exec echo '{}' \\ \; \
  31. | grep -v -f"../platform/unix/exclude" | head -c -3 >> Makefile.am
  32. printf "\n\n" >> Makefile.am
  33. cat >> Makefile.am << EOF
  34. if !LOVE_NOMPG123
  35. liblove_la_SOURCES += \\
  36. ./modules/sound/lullaby/Mpg123Decoder.cpp \\
  37. ./modules/sound/lullaby/Mpg123Decoder.h
  38. endif
  39. EOF
  40. cd ..
  41. echo "src/Makefile.am is updated! ^.^"