Remove old Makefiles
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
|
||||
########################
|
||||
# Utility Declarations #
|
||||
########################
|
||||
ifeq ($(VERBOSE_BUILD),true)
|
||||
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
|
||||
DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $<
|
||||
else
|
||||
DO_CC=@$(ECHO) "CC: $@" &&\
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
DO_CXX=@$(ECHO) "CXX: $@" &&\
|
||||
$(CXX) $(CFLAGS) -o $@ -c $<
|
||||
endif
|
||||
|
||||
#####################
|
||||
# Game Declarations #
|
||||
#####################
|
||||
GAME_HEADS := Game/GameEnts.h Game/GameMap.h
|
||||
GAME_OBJS := \
|
||||
$(BUILDDIR)/GameEnts.o \
|
||||
$(BUILDDIR)/GameMap.o \
|
||||
$(BUILDDIR)/main.o
|
||||
RES_GAME_OUT := $(BUILDDIR)/$(RES_GAME)
|
||||
|
||||
|
||||
#################
|
||||
# General Rules #
|
||||
#################
|
||||
|
||||
.FORCE:
|
||||
(cd $(GAMELIB_DIR) && make lib $(GAMELIB_MAKEPARAMS))
|
||||
|
||||
all: .FORCE $(BUILDDIR) $(RES_GAME_OUT)
|
||||
|
||||
$(BUILDDIR):
|
||||
$(MKDIR) $(BUILDDIR)
|
||||
|
||||
full-clean: clean
|
||||
(cd $(GAMELIB_DIR) && make clean $(GAMELIB_MAKEPARAMS))
|
||||
|
||||
clean:
|
||||
$(RM) $(BUILDDIR)
|
||||
|
||||
run: .FORCE $(BUILDDIR) $(RES_GAME_OUT)
|
||||
$(LAUNCHER) ./$(RES_GAME_OUT) debug
|
||||
|
||||
rebuild: clean all
|
||||
|
||||
|
||||
##############
|
||||
# Game Rules #
|
||||
##############
|
||||
|
||||
$(BUILDDIR)/GameEnts.o: src/GameEnts.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/GameMap.o: src/GameMap.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/main.o: src/main.c $(HEADS)
|
||||
$(DO_CC)
|
||||
|
||||
|
||||
|
||||
################
|
||||
# Result Rules #
|
||||
################
|
||||
|
||||
$(RES_GAME_OUT): $(GAME_OBJS)
|
||||
@$(ECHO) "LINK: $@"
|
||||
@$(CC) $(GAME_OBJS) $(STATICLIBS) -o $(RES_GAME_OUT) $(LIBS) $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
|
||||
########################
|
||||
# Utility Declarations #
|
||||
########################
|
||||
ifeq ($(VERBOSE_BUILD),true)
|
||||
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
|
||||
DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $<
|
||||
else
|
||||
DO_CC=@$(ECHO) "CC: $@" &&\
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
DO_CXX=@$(ECHO) "CXX: $@" &&\
|
||||
$(CXX) $(CFLAGS) -o $@ -c $<
|
||||
endif
|
||||
|
||||
########################
|
||||
# GameLib Declarations #
|
||||
########################
|
||||
CFLAGS += -Isrc
|
||||
GAMELIB_HEADS := \
|
||||
src/TimeUtils.h \
|
||||
src/Util.h \
|
||||
src/QuadArray2D.h \
|
||||
src/Draw.h \
|
||||
src/Input.h \
|
||||
src/Audio.h \
|
||||
src/Anim.h \
|
||||
src/Entity.h \
|
||||
src/GameLib.h
|
||||
GAMELIBS_OBJS := \
|
||||
$(BUILDDIR)/TimeUtils.o \
|
||||
$(BUILDDIR)/Util.o \
|
||||
$(BUILDDIR)/QuadArray2D.o \
|
||||
$(BUILDDIR)/Draw.o \
|
||||
$(BUILDDIR)/Input.o \
|
||||
$(BUILDDIR)/Audio.o \
|
||||
$(BUILDDIR)/Anim.o \
|
||||
$(BUILDDIR)/Entity.o \
|
||||
$(BUILDDIR)/GameLib.o
|
||||
RES_GAMELIB_OUT := $(BUILDDIR)/$(RES_GAMELIB)
|
||||
|
||||
#################
|
||||
# General Rules #
|
||||
#################
|
||||
all: $(BUILDDIR) $(RES_GAMELIB_OUT)
|
||||
|
||||
$(BUILDDIR):
|
||||
$(MKDIR) $(BUILDDIR)
|
||||
|
||||
clean:
|
||||
$(RM) $(BUILDDIR)
|
||||
|
||||
lib: $(BUILDDIR) $(RES_GAMELIB_OUT)
|
||||
|
||||
rebuild: clean all
|
||||
|
||||
#################
|
||||
# GameLib Rules #
|
||||
#################
|
||||
$(BUILDDIR)/TimeUtils.o: src/TimeUtils.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/Util.o: src/Util.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/QuadArray2D.o: src/QuadArray2D.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/Draw.o: src/Draw.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/Input.o: src/Input.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/Audio.o: src/Audio.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/Entity.o: src/Entity.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/Anim.o: src/Anim.c $(HEADS)
|
||||
$(DO_CC)
|
||||
$(BUILDDIR)/GameLib.o: src/GameLib.c $(HEADS)
|
||||
$(DO_CC)
|
||||
|
||||
|
||||
################
|
||||
# Result Rules #
|
||||
################
|
||||
|
||||
$(RES_GAMELIB_OUT): $(GAMELIBS_OBJS)
|
||||
@$(ECHO) "STATICLIB: $@"
|
||||
@$(AR) rcs $(RES_GAMELIB_OUT) $(GAMELIBS_OBJS)
|
||||
|
||||
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
prefix=$( dirname "$0" )
|
||||
usage="\
|
||||
Uso: gamelib-config [--cflags] [--libs] [--static-libs] [--builddir] [--platform]"
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Preparar configuracion
|
||||
uname=$( uname )
|
||||
unamem=$( uname -m )
|
||||
gcctarget=$( gcc -dumpmachine )
|
||||
if test $# -gt 0; then
|
||||
if test $1 = "emscripten"; then
|
||||
uname="EMSCRIPTEN"
|
||||
shift
|
||||
fi
|
||||
if test $1 = "Darwin"; then
|
||||
uname="Darwin"
|
||||
shift
|
||||
fi
|
||||
fi
|
||||
case "$uname" in
|
||||
*MINGW* | *MSYS*)
|
||||
# Configuracion de Win32/Mingw
|
||||
libs="-lopengl32 $(sdl2-config --libs)"
|
||||
cflags="-g -mwindows -D_GNU_SOURCE=1 -DWIN32 $(sdl2-config --cflags) -I$prefix/src"
|
||||
builddir="build-$gcctarget"
|
||||
platform="$gcctarget"
|
||||
exeextension=".exe"
|
||||
ldflags=""
|
||||
;;
|
||||
*EMSCRIPTEN*)
|
||||
# Configuracion de Emscripten
|
||||
libs=""
|
||||
cflags="-s USE_SDL=2 -O2 -Wno-implicit-function-declaration -I$prefix/src"
|
||||
builddir="build-emscripten"
|
||||
platform="emscripten"
|
||||
exeextension=".html"
|
||||
ldflags="--preload-file data -s TOTAL_MEMORY=134217728 -lidbfs.js"
|
||||
;;
|
||||
*Darwin*)
|
||||
# Configuracion de MacOSX
|
||||
libs="-framework Cocoa -lm -framework OpenGL -framework SDL $prefix/macosx/SDLMain.m"
|
||||
cflags="-Wall -g -DMACOSX -ObjC -Dmain=SDL_main -I/usr/include/ -I/usr/include/SDL/ -I/usr/X11R6/include/ -I$prefix/src"
|
||||
builddir="build-$gcctarget"
|
||||
platform="$gcctarget"
|
||||
exeextension=""
|
||||
ldflags=""
|
||||
;;
|
||||
*)
|
||||
# Configuracion de Linux
|
||||
libs="-lpthread -L/usr/X11R6/lib -L/usr/lib -lm -lGL -lX11 $(sdl2-config --libs)"
|
||||
cflags="-Wall -g -I/usr/include/ -I/usr/X11R6/include/ $(sdl2-config --cflags) -I$prefix/src"
|
||||
builddir="build-$gcctarget"
|
||||
platform="$gcctarget"
|
||||
exeextension=""
|
||||
ldflags=""
|
||||
;;
|
||||
esac
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
--cflags)
|
||||
echo "$cflags"
|
||||
;;
|
||||
--libs)
|
||||
echo "$libs"
|
||||
;;
|
||||
--ldflags)
|
||||
echo "$ldflags"
|
||||
;;
|
||||
--static-libs)
|
||||
echo "$prefix/$builddir/libgame.a"
|
||||
;;
|
||||
--builddir)
|
||||
echo "$builddir"
|
||||
;;
|
||||
--platform)
|
||||
echo "$platform"
|
||||
;;
|
||||
--exe-extension)
|
||||
echo "$exeextension"
|
||||
;;
|
||||
*)
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
Reference in New Issue
Block a user