GP2X A Batch *.bat File With All Paths Needed To Compile And Link A Gpe Fil


streak

Active Member
Joined
Jul 29, 2007
Messages
690
Age
41
Location
Poland & UK // Currently: Ipswich
Website
www.openpandora.pl
Hello

If anyone tries to compile a sdl_test.cpp wiith simple batch *.bat file [ without using any IDE ] in windows, please help. I need an one batch file eg. "compile_sdltest.bat" to compile and make a simple sdl_test.gpe without running IDE. I need all info for compiler and linker to be placed in this one batch *.bat file.

My sdk is placed in "C:\DEVKITGP2X\" directory.


StreaK
 
CODE
path=C:\devkitGP2X\bin

arm-linux-g++.exe -IC:\devkitGP2X\include -o test.gpe -LC:\devkitGP2X\lib -O2 -s -Wall

-DGP2X_PLATFORM main.cpp -static -lSDL -lgcc -lm -lc -lexpat -lpthread -msoft-float

pause


Compiles:
CODE
///////////////////////////////////////////////////////////////////////////////
/// @file main.cpp
/// @brief Template main file for an empty SDL shell on GP2X based off
/// Lazy Foo.
/// @author Steven Yau
/// @date 16 Aug 2007
///////////////////////////////////////////////////////////////////////////////

#include <SDl/SDL.h>

#ifdef PLATFORM_GP2X
#include <unistd.h>
#endif // PLATFORM_GP2X

const int SCREEN_WIDTH = 320;
const int SCREEN_HEIGHT = 240;

int main( int argc, char* args[] )
{
// Initialize all SDL subsystems
if( SDL_Init( SDL_INIT_EVERYTHING ) == -1 )
{
return 1;
}

// Create the screen surface
SDL_Surface * screen =
SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, 16, SDL_HWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF );

// Do PC specific stuff
#ifdef PLATFORM_PC
// Set the window caption
SDL_WM_SetCaption( "Hello World", NULL );
#endif // PLATFORM_PC

// Update the screen
if( SDL_Flip( screen ) == -1 )
{
return 1;
}

SDL_Quit();

// Do GP2X specific stuff
#ifdef PLATFORM_GP2X
// Return to the menu
chdir("/usr/gp2x");
execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
#endif // PLATFORM_GP2X

return 0;
}


Untested to work on GP2X

But for god's sake, use GNU makefile and makefile generation
 
real men and women type in their makefiles in the console as they need them.

edit: guess it wouldn't be a make "file" then though. :whistles:

but seriously, i can understand this request. i hate makefiles too. i was doing a lot of stuff from the command line.

then i "progressed" to copying and pasting the same makefile over and over.

but obviously for a program of any sort of complexity, generating a makefile the right way is the best solution.
 
rokdcasbah said:
but seriously, i can understand this request. i hate makefiles too. i was doing a lot of stuff from the command line.


Thats right, some makefiles are completely unuseable for windows user. For instance MakeFile for GnuRobbo [ http://gnurobbo.sourceforge.net/ ] is completely f*.*ed up, messed and You dont wanna even touch it by the stick. This makefile is a real pain in ass for windows user who dont use linux. Thats why i dont like it...

Let see how it looks like:

CODE

# Makefile.in generated by automake 1.7.1 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.

# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.



srcdir = .
top_srcdir = .

pkgdatadir = $(datadir)/gnurobbo
pkglibdir = $(libdir)/gnurobbo
pkgincludedir = $(includedir)/gnurobbo
top_builddir = .

am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = /usr/bin/install -c
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
ACLOCAL = ${SHELL} /home/alus/gnurobbo/gnurobbo-0.57/missing --run aclocal-1.7
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /home/alus/gnurobbo/gnurobbo-0.57/missing --run tar
AUTOCONF = ${SHELL} /home/alus/gnurobbo/gnurobbo-0.57/missing --run autoconf
AUTOHEADER = ${SHELL} /home/alus/gnurobbo/gnurobbo-0.57/missing --run autoheader
AUTOMAKE = ${SHELL} /home/alus/gnurobbo/gnurobbo-0.57/missing --run automake-1.7
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
EXEEXT =
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
LDFLAGS =
LIBS = -lpthread -lSDL_ttf -lSDL
LN_S = ln -s
LTLIBOBJS =
MAKEINFO = ${SHELL} /home/alus/gnurobbo/gnurobbo-0.57/missing --run makeinfo
OBJEXT = o
PACKAGE = gnurobbo
PACKAGE_BUGREPORT =
PACKAGE_NAME =
PACKAGE_STRING =
PACKAGE_TARNAME =
PACKAGE_VERSION =
PATH_SEPARATOR = :
SET_MAKE =
SHELL = /bin/sh
STRIP =
VERSION = 0.57
ac_ct_CC = gcc
ac_ct_STRIP =
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__include = include
am__quote =
bindir = ${exec_prefix}/bin
build_alias =
datadir = ${prefix}/share
exec_prefix = ${prefix}
host_alias =
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /home/alus/gnurobbo/gnurobbo-0.57/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localstatedir = ${prefix}/var
mandir = ${prefix}/man
oldincludedir = /usr/include
prefix = /usr/local
program_transform_name = s,x,x,
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target_alias =
bin_PROGRAMS = gnurobbo

gnurobbo_SOURCES = game.c game.h board.c data_init.c
EXTRA_DIST = levels.dat icons/icons.bmp robbo.ttf icons/ciphers.bmp icons/background.bmp
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
bin_PROGRAMS = gnurobbo$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)

am_gnurobbo_OBJECTS = game.$(OBJEXT) board.$(OBJEXT) data_init.$(OBJEXT)
gnurobbo_OBJECTS = $(am_gnurobbo_OBJECTS)
gnurobbo_LDADD = $(LDADD)
gnurobbo_DEPENDENCIES =
gnurobbo_LDFLAGS =

DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
DEP_FILES = ./$(DEPDIR)/board.Po ./$(DEPDIR)/data_init.Po \
./$(DEPDIR)/game.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(gnurobbo_SOURCES)
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
Makefile.in NEWS TODO aclocal.m4 config.h.in configure \
configure.ac depcomp install-sh missing mkinstalldirs
SOURCES = $(gnurobbo_SOURCES)

all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am

.SUFFIXES:
.SUFFIXES: .c .o .obj

am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)

$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)

$(ACLOCAL_M4): configure.ac
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)

config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi

stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h

$(srcdir)/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER)
touch $(srcdir)/config.h.in

distclean-hdr:
-rm -f config.h stamp-h1
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
else :; fi; \
done

uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done

clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
gnurobbo$(EXEEXT): $(gnurobbo_OBJECTS) $(gnurobbo_DEPENDENCIES)
@rm -f gnurobbo$(EXEEXT)
$(LINK) $(gnurobbo_LDFLAGS) $(gnurobbo_OBJECTS) $(gnurobbo_LDADD) $(LIBS)

mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core

distclean-compile:
-rm -f *.tab.c

include ./$(DEPDIR)/board.Po
include ./$(DEPDIR)/data_init.Po
include ./$(DEPDIR)/game.Po

distclean-depend:
-rm -rf ./$(DEPDIR)

.c.o:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
fi
# source='$<' object='$@' libtool=no \
# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
# $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<

.c.obj:
if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \
then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
fi
# source='$<' object='$@' libtool=no \
# depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
# $(CCDEPMODE) $(depcomp) \
# $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`
uninstall-info-am:

ETAGS = etags
ETAGSFLAGS =

CTAGS = ctags
CTAGSFLAGS =

tags: TAGS

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique

TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique

ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique

GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)

top_distdir = .
distdir = $(PACKAGE)-$(VERSION)

am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }

GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print

distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
$(mkinstalldirs) $(distdir)/icons
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir='; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} ; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} ; -o \
! -type d ! -perm -400 -exec chmod a+r {} ; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} ; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)

dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)

# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
$(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
distuninstallcheck:
cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:"; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi; \
$(distuninstallcheck_listfiles); \
exit 1; } >&2
distcleancheck: distclean
if test '$(srcdir)' = .; then \
echo "ERROR: distcleancheck can only run from a VPATH build"; \
exit 1; \
fi
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:"; \
$(distcleancheck_listfiles); \
exit 1; } >&2
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) config.h

installdirs:
$(mkinstalldirs) $(DESTDIR)$(bindir)

install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-binPROGRAMS clean-generic mostlyclean-am

distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-hdr distclean-tags

dvi: dvi-am

dvi-am:

info: info-am

info-am:

install-data-am: install-data-local

install-exec-am: install-binPROGRAMS

install-info: install-info-am

install-man:

installcheck-am:

maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf autom4te.cache
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-binPROGRAMS uninstall-info-am

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic ctags dist dist-all dist-gzip distcheck distclean \
distclean-compile distclean-depend distclean-generic \
distclean-hdr distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am \
install-data-local install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-info-am


install-data-local:
@$(NORMAL_INSTALL)
if test -d $(srcdir)/pixmaps; then \
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/pixmaps; \
for pixmap in $(srcdir)/pixmaps/*; do \
if test -f $$pixmap; then \
$(INSTALL_DATA) $$pixmap $(DESTDIR)$(pkgdatadir)/pixmaps; \
fi \
done \
fi
$(INSTALL_DATA) robbo.ttf $(DESTDIR)$(pkgdatadir)
$(INSTALL_DATA) levels.dat $(DESTDIR)$(pkgdatadir)

dist-hook:
if test -d pixmaps; then \
mkdir $(distdir)/pixmaps; \
for pixmap in pixmaps/*; do \
if test -f $$pixmap; then \
cp -p $$pixmap $(distdir)/pixmaps; \
fi \
done \
fi
cp -p robbo.ttf $(destdir)
cp -p levels.dat $(destdir)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
 
Last edited by a moderator:
QUOTE

Thats right, some makefiles are completely unuseable for windows user. For instance MakeFile for GnuRobbo [ http://gnurobbo.sourceforge.net/ ] is completely f*.*ed up, messed and You dont wanna even touch it by the stick. This makefile is a real pain in ass for windows user who dont use linux. Thats why i dont like it...

Let see how it looks like:




Yeah, but you could get a really messed up bat file if you wanted too :huh:

Honestly, compiling with a bat file isn't a terrible idea for a small project, but it only takes a tiny bit of work on a simple makefile and it'll save you loads of time recompiling for a slightly larger project.

Although i'm sure with a bit of extra work you could write a .bat file to replicate the behaviour of make, but why not just use make?

Sounds like you have a personal hate because of some horrible makefiles you've seen ;) But i'm sure you've seen some horrible C++ programs on the net, doesn't mean the language is bad.
 
QUOTE
Thats right, some makefiles are completely unuseable for windows user. For instance MakeFile for GnuRobbo [ http://gnurobbo.sourceforge.net/ ] is completely f*.*ed up, messed and You dont wanna even touch it by the stick. This makefile is a real pain in ass for windows user who dont use linux. Thats why i dont like it...


Thats why theres tools available to relieve the pain, such as Cygwin & VMWare :)

Simple single file projects can be done with a batch file easily, but multi-file projects really need a makefile unless you enjoy watching every file be compiled unnecessarily (and any possible support files).
 
StreaK said:
Thats right, some makefiles are completely unuseable for windows user. For instance MakeFile for GnuRobbo [ http://gnurobbo.sourceforge.net/ ] is completely f*.*ed up, messed and You dont wanna even touch it by the stick. This makefile is a real pain in ass for windows user who dont use linux. Thats why i dont like it...

Try writing it as a batch file then. I bet you end with exactly the same mess without the advantages of GNU make and using Windows commands. That is because it is a large scale project.

This is from Guyfawkes SDL Test:
CODE
CROSS_COMPILE = C:/devkitGP2X/bin/arm-linux-
SDL_BASE = C:/devkitGP2X/bin/arm-linux-
LDFLAGS = -static

CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip

CXXFLAGS = -I"C:/devkitGP2X/include" -I"C:/devkitGP2X/include/SDL" -DTARGET_GP2X -O2 -Wall
LIBS = -L"C:/devkitGP2X/lib" -lSDL -lSDL_gfx --start-group -lSDL_ttf -lfreetype -lSDL --end-group -lSDL_image -ljpeg -lpng12 -lz --start-group -lSDL_mixer -lvorbisidec -lmikmod -lsmpeg -lmad -lSDL --end-group -lgcc -lm -lc -lexpat -lpthread -ldl

TARGET = sdltest.gpe
OBJS = sdltest.o

ALL_TARGETS = $(TARGET)

all: $(ALL_TARGETS)

$(TARGET): $(OBJS)
$(CXX) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
$(STRIP) $(TARGET)

clean:
rm *.o
rm $(TARGET)


Simple, no?
 
Last edited by a moderator:
StreaK said:
Thats right, some makefiles are completely unuseable for windows user. For instance MakeFile for GnuRobbo [ http://gnurobbo.sourceforge.net/ ] is completely f*.*ed up, messed and You dont wanna even touch it by the stick. This makefile is a real pain in ass for windows user who dont use linux. Thats why i dont like it...

Let see how it looks like:



thats because it was AUTO GENERATED on a linux machine. its NOT designed to run on windows.

thats what the configure script is for.
 
Last edited by a moderator:
Exactly so.. thats a script that was generated for one platform; if generated for another, it'd be slightly different. Either way, not meant to be readable :)

Still, good makefiles are short and sweet and concise.

All you really need, for basic teeny jobs is:

all: myfoo
myfoo: mysource.c
gcc -o myfoo myfoo.o

Then customize it by dropping env-vars in there, and so on :)

jeff
 
Whoops, I just realised I made a mistake in the batch file for the code posted:
CODE
path=C:\devkitGP2X\bin

arm-linux-g++.exe -IC:\devkitGP2X\include -o test.gpe -LC:\devkitGP2X\lib -O2 -s -Wall

-DPLATFORM_GP2X main.cpp -static -lSDL -lgcc -lm -lc -lexpat -lpthread -msoft-float

pause

That explains the hanging of the program on the GP2X.
 
Here's a makefile for a slightly larger scale gp2x project, but with a makefile wrote for windows:

CODE

CROSS = arm-linux-
COPT = -g -static -I. -I$(devkit_path)include -O3 -mtune=arm920t -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math -D__GP2X__
GCC = $(CROSS)gcc
STRIP = $(CROSS)strip
AS = $(CROSS)gcc
RM = del

MYOBJS = unzip.o m3d_func.o gp2x_minimal.o gp2x_cpuctrl.o gp2x_squidgehack.o gp2x_myuname.o gp2x_asmutils.o gp2xmain.o
MYLIBS = menu/menu.lib normal-gfx-lib/pnormalgfx.lib quality-gfx-lib/pqualitygfx.lib
SPCOBJS = spc700/G1spc700a.o spc700/G2spc700a.o
OBJS = $(MYOBJS) $(SPCOBJS)
PRELIBS = $(MYLIBS) -lstdc++ -lm -lpng -lpthread -lz
SUBDIRS = menu normal-gfx-lib quality-gfx-lib
LIBDIRS = -L.

all: $(SUBDIRS) squidgesnes.gpe

.c.o:
$(GCC) $(COPT) -c $< -o $@

.s.o:
$(GCC) $(COPT) -c $< -o $@

.cpp.o:
$(GCC) $(COPT) -c $< -o $@

.PHONY: all subdirs $(SUBDIRS) clean up
.SILENT: $(SUBDIRS)

subdirs: $(SUBDIRS)

$(SUBDIRS):
make --no-print-directory -C $@

squidgesnes.gpe: squidgesnesd.gpe
$(STRIP) squidgesnesd.gpe -o squidgesnes.gpe

squidgesnesd.gpe: $(OBJS) $(MYLIBS)
$(GCC) $(COPT) $(OBJS) $(PRELIBS) $(LIBDIRS) -o $@

clean:
$(RM) squidgesnes.gpe
for %%i in ($(MYOBJS)) do $(RM) %%i
for %%i in ($(SUBDIRS)) do make -C %%i clean

up: squidgesnes.gpe
copy squidgesnes.gpe \\gp2x\gp2x\mnt\sd\




Simple and easy to maintain. No way would you ever want to do that using a batch file.
 
(Sorry change the topic)

Squidge
are these to maximize for speed? Im not familiar with some of these flags:
-mtune=arm920t -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math

Can you give a short reason why you use each one?
 
Pickle said:
(Sorry change the topic)

Squidge
are these to maximize for speed? Im not familiar with some of these flags:
-mtune=arm920t -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math

Can you give a short reason why you use each one?
unroll-loops will get rid of your loops and just repeat the inside lines the right number of times. a time/space tradeoff. fomit-frame-pointer basically gives you an extra register. not sure what the cost is, maybe you lose some debugging ability. fstrength-reduce has to do with a bug in gcc optimization code i think. not sure specifically what it does though. ffast-math does things to optimize math, like making assumptions in the various operations (square roots don't contain negative numbers, for instance)

don't know about the rest.
 
Last edited by a moderator:
rokdcasbah said:
Pickle said:
(Sorry change the topic)

Squidge
are these to maximize for speed? Im not familiar with some of these flags:
-mtune=arm920t -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math

Can you give a short reason why you use each one?
unroll-loops will get rid of your loops and just repeat the inside lines the right number of times. a time/space tradeoff. fomit-frame-pointer basically gives you an extra register. not sure what the cost is, maybe you lose some debugging ability. fstrength-reduce has to do with a bug in gcc optimization code i think. not sure specifically what it does though. ffast-math does things to optimize math, like making assumptions in the various operations (square roots don't contain negative numbers, for instance)

don't know about the rest.


Thanks, I had guesses on some of them.
-mtune=arm920t is the one im really curious about though.
 
Last edited by a moderator:
Pickle said:
-mtune=arm920t is the one im really curious about though.
i think that it's used in cases where you want code that will run on a family of chips, but still be able to optimize it for one or another specific one (by using different microcode, maybe).

but take that with a grain of salt...more of a "hello world" guy myself.

if you're wondering if you should use it...stuff like that's always worth a shot :D
 
Last edited by a moderator:
rokdcasbah said:
Pickle said:
-mtune=arm920t is the one im really curious about though.
i think that it's used in cases where you want code that will run on a family of chips, but still be able to optimize it for one or another specific one (by using different microcode, maybe).

but take that with a grain of salt...more of a "hello world" guy myself.

if you're wondering if you should use it...stuff like that's always worth a shot :D


I used all of the flags in my programs and the gpe increased in size as expected, but there wasnt any huge performance gains.
 
Last edited by a moderator:
Back
Top