diff options
author | Björn Stenberg <bjorn@haxx.se> | 2008-11-20 11:27:31 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2008-11-20 11:27:31 +0000 |
commit | c6b3d38a156dd624760a8eb1bb374affd43b4f2a (patch) | |
tree | 493eba929e2396d86cf4f077709aa09fe172cd35 /apps/plugins/jpeg | |
parent | f66c30346783a400a029bedcd60ab67c81c34a07 (diff) | |
download | rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.tar.gz rockbox-c6b3d38a156dd624760a8eb1bb374affd43b4f2a.zip |
New makefile solution: A single invocation of 'make' to build the entire tree. Fully controlled dependencies give faster and more correct recompiles.
Many #include lines adjusted to conform to the new standards.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19146 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/jpeg')
-rw-r--r-- | apps/plugins/jpeg/Makefile | 75 | ||||
-rw-r--r-- | apps/plugins/jpeg/jpeg.make | 21 |
2 files changed, 21 insertions, 75 deletions
diff --git a/apps/plugins/jpeg/Makefile b/apps/plugins/jpeg/Makefile deleted file mode 100644 index 83207258b5..0000000000 --- a/apps/plugins/jpeg/Makefile +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id$ | ||
8 | # | ||
9 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \ | ||
12 | -I$(BUILDDIR)/pluginbitmaps -I$(APPSDIR)/plugins/lib | ||
13 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
14 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | LINKFILE := $(OBJDIR)/link.lds | ||
21 | DEPFILE = $(OBJDIR)/dep-jpeg | ||
22 | |||
23 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
24 | include $(TOOLSDIR)/makesrc.inc | ||
25 | |||
26 | SOURCES = $(SRC) | ||
27 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
28 | DIRS = . | ||
29 | |||
30 | ifndef SIMVER | ||
31 | LDS := ../plugin.lds | ||
32 | OUTPUT = $(OUTDIR)/jpeg.rock | ||
33 | else ## simulators | ||
34 | OUTPUT = $(OUTDIR)/jpeg.rock | ||
35 | endif | ||
36 | |||
37 | all: $(OUTPUT) | ||
38 | |||
39 | ifndef SIMVER | ||
40 | $(OBJDIR)/jpeg.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS) | ||
41 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \ | ||
42 | $(LINKBITMAPS) -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/jpeg.map | ||
43 | |||
44 | $(OUTPUT): $(OBJDIR)/jpeg.elf | ||
45 | $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ | ||
46 | else | ||
47 | ################################################### | ||
48 | # This is the SDL simulator version | ||
49 | |||
50 | $(OUTPUT): $(OBJS) | ||
51 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ | ||
52 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
53 | # 'x' must be kept or you'll have "Win32 error 5" | ||
54 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
55 | # #define ERROR_ACCESS_DENIED 5L | ||
56 | else | ||
57 | @chmod -x $@ | ||
58 | endif | ||
59 | |||
60 | endif # end of simulator section | ||
61 | |||
62 | |||
63 | include $(TOOLSDIR)/make.inc | ||
64 | |||
65 | # MEMORYSIZE should be passed on to this makefile with the chosen memory size | ||
66 | # given in number of MB | ||
67 | $(LINKFILE): $(LDS) | ||
68 | $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \ | ||
69 | $(DEFINES) -E -P - >$@ | ||
70 | |||
71 | clean: | ||
72 | $(call PRINTS,cleaning jpeg)rm -rf $(OBJDIR)/jpeg | ||
73 | $(SILENT)rm -f $(OBJDIR)/jpeg.* $(DEPFILE) | ||
74 | |||
75 | -include $(DEPFILE) | ||
diff --git a/apps/plugins/jpeg/jpeg.make b/apps/plugins/jpeg/jpeg.make new file mode 100644 index 0000000000..9413ef24b3 --- /dev/null +++ b/apps/plugins/jpeg/jpeg.make | |||
@@ -0,0 +1,21 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $ | ||
8 | # | ||
9 | |||
10 | JPEGSRCDIR := $(APPSDIR)/plugins/jpeg | ||
11 | JPEGBUILDDIR := $(BUILDDIR)/apps/plugins/jpeg | ||
12 | |||
13 | ROCKS += $(JPEGBUILDDIR)/jpeg.rock | ||
14 | |||
15 | JPEG_SRC := $(call preprocess, $(JPEGSRCDIR)/SOURCES) | ||
16 | JPEG_OBJ := $(call c2obj, $(JPEG_SRC)) | ||
17 | |||
18 | # add source files to OTHER_SRC to get automatic dependencies | ||
19 | OTHER_SRC += $(JPEG_SRC) | ||
20 | |||
21 | $(JPEGBUILDDIR)/jpeg.rock: $(JPEG_OBJ) | ||