diff options
| author | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-17 20:50:03 +0000 |
|---|---|---|
| committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-17 20:50:03 +0000 |
| commit | 27be5bc72855a0fbbdae230bc144624c9eb85f5e (patch) | |
| tree | b553f1321df924c4b744ffcab48dce5f4f081f7d /apps/codecs/dumb/make | |
| parent | 7e7662bb716917ca431204f0113d400c1014f2e8 (diff) | |
| download | rockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.zip rockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.tar.gz rockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.tar.bz2 rockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.tar.xz | |
Initial check in dumb 0.9.2 - has a few usages of floating point that should
be rewritten to fixed point. seems to compile cleanly for iriver.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6197 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/dumb/make')
| -rw-r--r-- | apps/codecs/dumb/make/Makefile.inc | 34 | ||||
| -rw-r--r-- | apps/codecs/dumb/make/config.bat | 33 | ||||
| -rwxr-xr-x | apps/codecs/dumb/make/config.sh | 35 | ||||
| -rw-r--r-- | apps/codecs/dumb/make/config.txt | 3 | ||||
| -rw-r--r-- | apps/codecs/dumb/make/djgpp.inc | 28 | ||||
| -rwxr-xr-x | apps/codecs/dumb/make/dumbask | bin | 0 -> 12700 bytes | |||
| -rw-r--r-- | apps/codecs/dumb/make/dumbask.c | 30 | ||||
| -rw-r--r-- | apps/codecs/dumb/make/mingw.inc | 28 | ||||
| -rw-r--r-- | apps/codecs/dumb/make/unix.inc | 20 |
9 files changed, 211 insertions, 0 deletions
diff --git a/apps/codecs/dumb/make/Makefile.inc b/apps/codecs/dumb/make/Makefile.inc new file mode 100644 index 0000000..4137b04 --- /dev/null +++ b/apps/codecs/dumb/make/Makefile.inc @@ -0,0 +1,34 @@ +# This file contains the main rules for compiling the library. It is included +# twice with different values for CFLAGS and OBJDIR, so the optimised and +# debugging libraries are both built. + +CORE_OBJECTS := $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c, %.o, $(CORE_MODULES)))) +ALLEGRO_OBJECTS := $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c, %.o, $(ALLEGRO_MODULES)))) + + +# Pass the current value of CFLAGS through to the commands. Or, more +# accurately, create a local copy of the current CFLAGS variable. This is +# necessary because Make doesn't expand variables in commands until they are +# executed. +$(CORE_LIB_FILE): CFLAGS := $(CFLAGS) +$(ALLEGRO_LIB_FILE): CFLAGS := $(CFLAGS) + + +$(OBJDIR)/%.o: src/core/%.c include/dumb.h include/internal/dumb.h + $(CC) -c -o $@ $< $(CFLAGS) + +$(OBJDIR)/%.o: src/helpers/%.c include/dumb.h + $(CC) -c -o $@ $< $(CFLAGS) + +$(OBJDIR)/%.o: src/it/%.c include/dumb.h include/internal/it.h + $(CC) -c -o $@ $< $(CFLAGS) + +$(OBJDIR)/%.o: src/allegro/%.c include/aldumb.h include/dumb.h \ + include/internal/aldumb.h include/internal/dumb.h + $(CC) -c -o $@ $< $(CFLAGS) $(WFLAGS_ALLEGRO) + +$(CORE_LIB_FILE): $(CORE_OBJECTS) + $(AR) rs $@ $^ + +$(ALLEGRO_LIB_FILE): $(ALLEGRO_OBJECTS) + $(AR) rs $@ $^ diff --git a/apps/codecs/dumb/make/config.bat b/apps/codecs/dumb/make/config.bat new file mode 100644 index 0000000..2d33a61 --- /dev/null +++ b/apps/codecs/dumb/make/config.bat @@ -0,0 +1,33 @@ +@ECHO OFF + +REM This file does an interactive configuration for users of DOS and Windows. +REM It creates a config.txt file for inclusion in the Makefile. This batch +REM file should be run indirectly through the 'make config' target (or the +REM 'make' target the first time). + +IF EXIST make\dumbask.exe GOTO dumbaskok +ECHO You should not be running this directly! Use 'make' or 'make config'. +GOTO end +:dumbaskok + +make\dumbask.exe "Would you like to compile DUMB for DJGPP or MinGW (D/M)? " DM +IF ERRORLEVEL 1 GOTO mingw +ECHO include make/djgpp.inc>make\config.tmp +GOTO djgpp +:mingw +ECHO include make/mingw.inc>make\config.tmp +:djgpp + +ECHO ALL_TARGETS := core core-examples core-headers>>make\config.tmp + +make\dumbask.exe "Would you like support for Allegro (Y/N)? " +IF NOT ERRORLEVEL 1 ECHO ALL_TARGETS += allegro allegro-examples allegro-headers>>make\config.tmp + +IF EXIST make\config.txt DEL make\config.txt +REN make\config.tmp config.txt + +ECHO Configuration complete. +ECHO Run 'make config' to change it in the future. +PAUSE + +:end diff --git a/apps/codecs/dumb/make/config.sh b/apps/codecs/dumb/make/config.sh new file mode 100755 index 0000000..f42e141 --- /dev/null +++ b/apps/codecs/dumb/make/config.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# This file does an interactive configuration for users of Unix-like systems. +# It creates a config.txt file for inclusion in the Makefile. This script +# should be run indirectly through the 'make config' target (or the 'make' +# target the first time). + +if [ ! -e make/dumbask ]; then + echo "You should not be running this directly! Use 'make' or 'make config'." + exit +fi + +echo 'include make/unix.inc' > make/config.tmp + +echo 'ALL_TARGETS := core core-examples core-headers' >> make/config.tmp + +if make/dumbask 'Would you like support for Allegro (Y/N)? ' YN; then + echo 'ALL_TARGETS += allegro allegro-examples allegro-headers' >> make/config.tmp +fi + + +if [ ! -z $DEFAULT_PREFIX ]; then +echo "Please specify an installation prefix (default $DEFAULT_PREFIX)." +echo -n '> ' +read PREFIX +if [ -z $PREFIX ]; then PREFIX=$DEFAULT_PREFIX; fi +echo "PREFIX := $PREFIX" >> make/config.tmp +fi + +mv -f make/config.tmp make/config.txt + +echo 'Configuration complete.' +echo "Run 'make config' to change it in the future." +echo -n 'Press Enter to continue ... ' +read diff --git a/apps/codecs/dumb/make/config.txt b/apps/codecs/dumb/make/config.txt new file mode 100644 index 0000000..abe4397 --- /dev/null +++ b/apps/codecs/dumb/make/config.txt @@ -0,0 +1,3 @@ +include make/unix.inc +ALL_TARGETS := core +PREFIX := /usr diff --git a/apps/codecs/dumb/make/djgpp.inc b/apps/codecs/dumb/make/djgpp.inc new file mode 100644 index 0000000..4147ab2 --- /dev/null +++ b/apps/codecs/dumb/make/djgpp.inc @@ -0,0 +1,28 @@ +# This file contains DJGPP-specific definitions. It will be included by the +# main Makefile when you compile with DJGPP. + +PLATFORM := djgpp + +APOST := \' + +# Macro for replacing / with \ where necessary. Usage: $(call FIX,path) +FIX = $(subst /,\,$(subst /*,\\\*,$(1))) + +ECHO = @$(COMSPEC) /C ECHO $(1) +# Note: the following two macros only work for single files! +DELETE = $(COMSPEC) /C DEL $(call FIX,$(1)) +COPY = $(COMSPEC) /C COPY $(call FIX,$(1)) $(call FIX,$(2)) + +EXE_SUFFIX := .exe + +LINK_MATH := +LINK_ALLEGRO := -lalleg + +ifndef DJDIR +.PHONY: error +error: + $(call ECHO,Your DJDIR environment variable is not set!) + $(call ECHO,Please refer to DJGPP's documentation and install it properly.) +endif + +PREFIX := $(DJDIR) diff --git a/apps/codecs/dumb/make/dumbask b/apps/codecs/dumb/make/dumbask Binary files differnew file mode 100755 index 0000000..ee6f5f7 --- /dev/null +++ b/apps/codecs/dumb/make/dumbask diff --git a/apps/codecs/dumb/make/dumbask.c b/apps/codecs/dumb/make/dumbask.c new file mode 100644 index 0000000..da89fab --- /dev/null +++ b/apps/codecs/dumb/make/dumbask.c @@ -0,0 +1,30 @@ +#include <stdio.h> +#include <ctype.h> + + +int main(int argc, const char *const argv[]) +{ + const char *message = argv[1]; + const char *options; + + if (!message) { + fprintf(stderr, + "dumbask: asks the user a question.\n" + "Specify a message as the first argument (quoted!).\n" + "You may optionally specify the choices as the second argument.\n" + "Default choices are YN. Exit code is 0 for first, 1 for second, etc.\n"); + return 0; + } + + options = argv[2] ? : "YN"; /* I _had_ to use a GNU Extension _somewhere_! */ + + printf("%s", argv[1]); + + for (;;) { + char c = toupper(getchar()); + int i; + for (i = 0; options[i]; i++) + if (c == toupper(options[i])) + return i; + } +} diff --git a/apps/codecs/dumb/make/mingw.inc b/apps/codecs/dumb/make/mingw.inc new file mode 100644 index 0000000..e58de58 --- /dev/null +++ b/apps/codecs/dumb/make/mingw.inc @@ -0,0 +1,28 @@ +# This file contains MinGW-specific definitions. It will be included by the +# main Makefile when you compile with MinGW. + +PLATFORM := mingw + +APOST := \' + +# Macro for replacing / with \ where necessary. Usage: $(call FIX,path) +FIX = $(subst /,\,$(subst /*,\\\*,$(1))) + +ECHO = @$(COMSPEC) /C ECHO $(1) +# Note: the following two macros only work for single files! +DELETE = $(COMSPEC) /C DEL $(call FIX,$(1)) +COPY = $(COMSPEC) /C COPY $(call FIX,$(1)) $(call FIX,$(2)) + +EXE_SUFFIX := .exe + +LINK_MATH := +LINK_ALLEGRO := -lalleg + +ifndef MINGDIR +.PHONY: error +error: + $(call ECHO,Your MINGDIR environment variable is not set!) + $(call ECHO,Please set it to point to the directory containing your MinGW installation.) +endif + +PREFIX := $(MINGDIR) diff --git a/apps/codecs/dumb/make/unix.inc b/apps/codecs/dumb/make/unix.inc new file mode 100644 index 0000000..89d47c0 --- /dev/null +++ b/apps/codecs/dumb/make/unix.inc @@ -0,0 +1,20 @@ +# This file contains definitions suitable for Unix-compatible systems. It will +# be included by the main Makefile when you compile on such a system. + +PLATFORM := unix + +APOST := \' + +# Macro that on DOS and Windows would replace / with \. Usage: $(call FIX,path) +FIX = $(1) + +ECHO = @echo $(1) +DELETE = rm -f $(1) +COPY = cp $(1) $(2) + +EXE_SUFFIX := + +LINK_MATH := -lm +LINK_ALLEGRO := `allegro-config --libs` + +# PREFIX is set by config.sh. |