mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
86f3ee4775
Uses SDL2's sdl2.m4 macros, which are installed along with SDL2. This ensures that the correct flags are given to the compiler and linker.
49 lines
1.2 KiB
Bash
49 lines
1.2 KiB
Bash
#!/bin/bash
|
|
echo Generating src/Makefile.am ...
|
|
cd src
|
|
inc_current='$(srcdir)'
|
|
inc_modules="$inc_current/modules"
|
|
inc_libraries="$inc_current/libraries"
|
|
|
|
cat > Makefile.am << EOF
|
|
AM_CPPFLAGS = -I$inc_current -I$inc_modules -I$inc_libraries -I$inc_libraries/enet/libenet/include \$(LOVE_INCLUDES) \$(FILE_OFFSET)
|
|
AM_CXXFLAGS = \$(SDL_CFLAGS)
|
|
AUTOMAKE_OPTIONS = subdir-objects
|
|
SUBDIRS =
|
|
|
|
if LOVE_BUILD_EXE
|
|
# LÖVE executable
|
|
bin_PROGRAMS = love
|
|
#love_LDFLAGS =
|
|
love_LDADD = liblove.la
|
|
love_SOURCES = love.cpp
|
|
endif
|
|
|
|
# Compile scripts
|
|
#scripts/%.lua.h: scripts/%.lua
|
|
# cd scripts; \
|
|
# lua auto.lua \$*
|
|
#TODO: Figure out how to only do this on gnu make, and detect which lua
|
|
# executable to run
|
|
|
|
# libLÖVE
|
|
lib_LTLIBRARIES = liblove.la
|
|
liblove_la_LDFLAGS = -module -export-dynamic \$(LDFLAGS) \$(SDL_LIBS)
|
|
liblove_la_SOURCES = \\
|
|
EOF
|
|
|
|
find . \( \( -iname "*.c" -o -iname "*.cpp" -o -iname "*.h" -o -iname "*.lch" \) \) -exec echo '{}' \\ \; \
|
|
| grep -v -f"../platform/unix/exclude" | head -c -3 >> Makefile.am
|
|
|
|
printf "\n\n" >> Makefile.am
|
|
cat >> Makefile.am << EOF
|
|
if !LOVE_NOMPG123
|
|
liblove_la_SOURCES += \\
|
|
./modules/sound/lullaby/Mpg123Decoder.cpp \\
|
|
./modules/sound/lullaby/Mpg123Decoder.h
|
|
endif
|
|
EOF
|
|
|
|
cd ..
|
|
echo "src/Makefile.am is updated! ^.^"
|