Gigabeat S: Make MIN_BRIGHTNESS_SETTING to be 1, not 0; the backlight already has...
[kugel-rb.git] / apps / plugins / jpeg / Makefile
blob83207258b56d6f920f7d3ec550b82ad7c30e2ef8
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
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
16 ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18 endif
20 LINKFILE := $(OBJDIR)/link.lds
21 DEPFILE = $(OBJDIR)/dep-jpeg
23 # This sets up 'SRC' based on the files mentioned in SOURCES
24 include $(TOOLSDIR)/makesrc.inc
26 SOURCES = $(SRC)
27 OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
28 DIRS = .
30 ifndef SIMVER
31 LDS := ../plugin.lds
32 OUTPUT = $(OUTDIR)/jpeg.rock
33 else ## simulators
34 OUTPUT = $(OUTDIR)/jpeg.rock
35 endif
37 all: $(OUTPUT)
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
44 $(OUTPUT): $(OBJDIR)/jpeg.elf
45 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
46 else
47 ###################################################
48 # This is the SDL simulator version
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
60 endif # end of simulator section
63 include $(TOOLSDIR)/make.inc
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 - >$@
71 clean:
72 $(call PRINTS,cleaning jpeg)rm -rf $(OBJDIR)/jpeg
73 $(SILENT)rm -f $(OBJDIR)/jpeg.* $(DEPFILE)
75 -include $(DEPFILE)