summaryrefslogtreecommitdiff
path: root/apps/codecs/dumb/make
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-03-17 20:50:03 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-03-17 20:50:03 +0000
commit27be5bc72855a0fbbdae230bc144624c9eb85f5e (patch)
treeb553f1321df924c4b744ffcab48dce5f4f081f7d /apps/codecs/dumb/make
parent7e7662bb716917ca431204f0113d400c1014f2e8 (diff)
downloadrockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.tar.gz
rockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.zip
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.inc34
-rw-r--r--apps/codecs/dumb/make/config.bat33
-rwxr-xr-xapps/codecs/dumb/make/config.sh35
-rw-r--r--apps/codecs/dumb/make/config.txt3
-rw-r--r--apps/codecs/dumb/make/djgpp.inc28
-rwxr-xr-xapps/codecs/dumb/make/dumbaskbin0 -> 12700 bytes
-rw-r--r--apps/codecs/dumb/make/dumbask.c30
-rw-r--r--apps/codecs/dumb/make/mingw.inc28
-rw-r--r--apps/codecs/dumb/make/unix.inc20
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 0000000000..4137b04804
--- /dev/null
+++ b/apps/codecs/dumb/make/Makefile.inc
@@ -0,0 +1,34 @@
1# This file contains the main rules for compiling the library. It is included
2# twice with different values for CFLAGS and OBJDIR, so the optimised and
3# debugging libraries are both built.
4
5CORE_OBJECTS := $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c, %.o, $(CORE_MODULES))))
6ALLEGRO_OBJECTS := $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c, %.o, $(ALLEGRO_MODULES))))
7
8
9# Pass the current value of CFLAGS through to the commands. Or, more
10# accurately, create a local copy of the current CFLAGS variable. This is
11# necessary because Make doesn't expand variables in commands until they are
12# executed.
13$(CORE_LIB_FILE): CFLAGS := $(CFLAGS)
14$(ALLEGRO_LIB_FILE): CFLAGS := $(CFLAGS)
15
16
17$(OBJDIR)/%.o: src/core/%.c include/dumb.h include/internal/dumb.h
18 $(CC) -c -o $@ $< $(CFLAGS)
19
20$(OBJDIR)/%.o: src/helpers/%.c include/dumb.h
21 $(CC) -c -o $@ $< $(CFLAGS)
22
23$(OBJDIR)/%.o: src/it/%.c include/dumb.h include/internal/it.h
24 $(CC) -c -o $@ $< $(CFLAGS)
25
26$(OBJDIR)/%.o: src/allegro/%.c include/aldumb.h include/dumb.h \
27 include/internal/aldumb.h include/internal/dumb.h
28 $(CC) -c -o $@ $< $(CFLAGS) $(WFLAGS_ALLEGRO)
29
30$(CORE_LIB_FILE): $(CORE_OBJECTS)
31 $(AR) rs $@ $^
32
33$(ALLEGRO_LIB_FILE): $(ALLEGRO_OBJECTS)
34 $(AR) rs $@ $^
diff --git a/apps/codecs/dumb/make/config.bat b/apps/codecs/dumb/make/config.bat
new file mode 100644
index 0000000000..2d33a61511
--- /dev/null
+++ b/apps/codecs/dumb/make/config.bat
@@ -0,0 +1,33 @@
1@ECHO OFF
2
3REM This file does an interactive configuration for users of DOS and Windows.
4REM It creates a config.txt file for inclusion in the Makefile. This batch
5REM file should be run indirectly through the 'make config' target (or the
6REM 'make' target the first time).
7
8IF EXIST make\dumbask.exe GOTO dumbaskok
9ECHO You should not be running this directly! Use 'make' or 'make config'.
10GOTO end
11:dumbaskok
12
13make\dumbask.exe "Would you like to compile DUMB for DJGPP or MinGW (D/M)? " DM
14IF ERRORLEVEL 1 GOTO mingw
15ECHO include make/djgpp.inc>make\config.tmp
16GOTO djgpp
17:mingw
18ECHO include make/mingw.inc>make\config.tmp
19:djgpp
20
21ECHO ALL_TARGETS := core core-examples core-headers>>make\config.tmp
22
23make\dumbask.exe "Would you like support for Allegro (Y/N)? "
24IF NOT ERRORLEVEL 1 ECHO ALL_TARGETS += allegro allegro-examples allegro-headers>>make\config.tmp
25
26IF EXIST make\config.txt DEL make\config.txt
27REN make\config.tmp config.txt
28
29ECHO Configuration complete.
30ECHO Run 'make config' to change it in the future.
31PAUSE
32
33:end
diff --git a/apps/codecs/dumb/make/config.sh b/apps/codecs/dumb/make/config.sh
new file mode 100755
index 0000000000..f42e141176
--- /dev/null
+++ b/apps/codecs/dumb/make/config.sh
@@ -0,0 +1,35 @@
1#!/bin/sh
2
3# This file does an interactive configuration for users of Unix-like systems.
4# It creates a config.txt file for inclusion in the Makefile. This script
5# should be run indirectly through the 'make config' target (or the 'make'
6# target the first time).
7
8if [ ! -e make/dumbask ]; then
9 echo "You should not be running this directly! Use 'make' or 'make config'."
10 exit
11fi
12
13echo 'include make/unix.inc' > make/config.tmp
14
15echo 'ALL_TARGETS := core core-examples core-headers' >> make/config.tmp
16
17if make/dumbask 'Would you like support for Allegro (Y/N)? ' YN; then
18 echo 'ALL_TARGETS += allegro allegro-examples allegro-headers' >> make/config.tmp
19fi
20
21
22if [ ! -z $DEFAULT_PREFIX ]; then
23echo "Please specify an installation prefix (default $DEFAULT_PREFIX)."
24echo -n '> '
25read PREFIX
26if [ -z $PREFIX ]; then PREFIX=$DEFAULT_PREFIX; fi
27echo "PREFIX := $PREFIX" >> make/config.tmp
28fi
29
30mv -f make/config.tmp make/config.txt
31
32echo 'Configuration complete.'
33echo "Run 'make config' to change it in the future."
34echo -n 'Press Enter to continue ... '
35read
diff --git a/apps/codecs/dumb/make/config.txt b/apps/codecs/dumb/make/config.txt
new file mode 100644
index 0000000000..abe4397216
--- /dev/null
+++ b/apps/codecs/dumb/make/config.txt
@@ -0,0 +1,3 @@
1include make/unix.inc
2ALL_TARGETS := core
3PREFIX := /usr
diff --git a/apps/codecs/dumb/make/djgpp.inc b/apps/codecs/dumb/make/djgpp.inc
new file mode 100644
index 0000000000..4147ab26a4
--- /dev/null
+++ b/apps/codecs/dumb/make/djgpp.inc
@@ -0,0 +1,28 @@
1# This file contains DJGPP-specific definitions. It will be included by the
2# main Makefile when you compile with DJGPP.
3
4PLATFORM := djgpp
5
6APOST := \'
7
8# Macro for replacing / with \ where necessary. Usage: $(call FIX,path)
9FIX = $(subst /,\,$(subst /*,\\\*,$(1)))
10
11ECHO = @$(COMSPEC) /C ECHO $(1)
12# Note: the following two macros only work for single files!
13DELETE = $(COMSPEC) /C DEL $(call FIX,$(1))
14COPY = $(COMSPEC) /C COPY $(call FIX,$(1)) $(call FIX,$(2))
15
16EXE_SUFFIX := .exe
17
18LINK_MATH :=
19LINK_ALLEGRO := -lalleg
20
21ifndef DJDIR
22.PHONY: error
23error:
24 $(call ECHO,Your DJDIR environment variable is not set!)
25 $(call ECHO,Please refer to DJGPP's documentation and install it properly.)
26endif
27
28PREFIX := $(DJDIR)
diff --git a/apps/codecs/dumb/make/dumbask b/apps/codecs/dumb/make/dumbask
new file mode 100755
index 0000000000..ee6f5f7ecd
--- /dev/null
+++ b/apps/codecs/dumb/make/dumbask
Binary files differ
diff --git a/apps/codecs/dumb/make/dumbask.c b/apps/codecs/dumb/make/dumbask.c
new file mode 100644
index 0000000000..da89fab97b
--- /dev/null
+++ b/apps/codecs/dumb/make/dumbask.c
@@ -0,0 +1,30 @@
1#include <stdio.h>
2#include <ctype.h>
3
4
5int main(int argc, const char *const argv[])
6{
7 const char *message = argv[1];
8 const char *options;
9
10 if (!message) {
11 fprintf(stderr,
12 "dumbask: asks the user a question.\n"
13 "Specify a message as the first argument (quoted!).\n"
14 "You may optionally specify the choices as the second argument.\n"
15 "Default choices are YN. Exit code is 0 for first, 1 for second, etc.\n");
16 return 0;
17 }
18
19 options = argv[2] ? : "YN"; /* I _had_ to use a GNU Extension _somewhere_! */
20
21 printf("%s", argv[1]);
22
23 for (;;) {
24 char c = toupper(getchar());
25 int i;
26 for (i = 0; options[i]; i++)
27 if (c == toupper(options[i]))
28 return i;
29 }
30}
diff --git a/apps/codecs/dumb/make/mingw.inc b/apps/codecs/dumb/make/mingw.inc
new file mode 100644
index 0000000000..e58de58788
--- /dev/null
+++ b/apps/codecs/dumb/make/mingw.inc
@@ -0,0 +1,28 @@
1# This file contains MinGW-specific definitions. It will be included by the
2# main Makefile when you compile with MinGW.
3
4PLATFORM := mingw
5
6APOST := \'
7
8# Macro for replacing / with \ where necessary. Usage: $(call FIX,path)
9FIX = $(subst /,\,$(subst /*,\\\*,$(1)))
10
11ECHO = @$(COMSPEC) /C ECHO $(1)
12# Note: the following two macros only work for single files!
13DELETE = $(COMSPEC) /C DEL $(call FIX,$(1))
14COPY = $(COMSPEC) /C COPY $(call FIX,$(1)) $(call FIX,$(2))
15
16EXE_SUFFIX := .exe
17
18LINK_MATH :=
19LINK_ALLEGRO := -lalleg
20
21ifndef MINGDIR
22.PHONY: error
23error:
24 $(call ECHO,Your MINGDIR environment variable is not set!)
25 $(call ECHO,Please set it to point to the directory containing your MinGW installation.)
26endif
27
28PREFIX := $(MINGDIR)
diff --git a/apps/codecs/dumb/make/unix.inc b/apps/codecs/dumb/make/unix.inc
new file mode 100644
index 0000000000..89d47c0997
--- /dev/null
+++ b/apps/codecs/dumb/make/unix.inc
@@ -0,0 +1,20 @@
1# This file contains definitions suitable for Unix-compatible systems. It will
2# be included by the main Makefile when you compile on such a system.
3
4PLATFORM := unix
5
6APOST := \'
7
8# Macro that on DOS and Windows would replace / with \. Usage: $(call FIX,path)
9FIX = $(1)
10
11ECHO = @echo $(1)
12DELETE = rm -f $(1)
13COPY = cp $(1) $(2)
14
15EXE_SUFFIX :=
16
17LINK_MATH := -lm
18LINK_ALLEGRO := `allegro-config --libs`
19
20# PREFIX is set by config.sh.