FS#12756 by Marek Salaba - update Czech translation
[maemo-rb.git] / apps / plugins / lua / Makefile
blob8568d79c4c1d0a125668a9cc757ff1a2801a820a
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
8 OPT_FLAGS=-O0
10 INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) -I. $(TARGET_INC)
12 CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS)
15 ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17 endif
19 LINKFILE := $(OBJDIR)/link.lds
20 DEPFILE = $(OBJDIR)/dep-lua
22 # This sets up 'SRC' based on the files mentioned in SOURCES
23 include $(TOOLSDIR)/makesrc.inc
25 SOURCES = $(SRC)
26 OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
27 OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
28 DIRS = .
30 ifndef APP_TYPE
31 ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
32 LDS := archos.lds
33 OUTPUT = $(OUTDIR)/lua.ovl
34 else ## iRiver/iPod/... targets
35 LDS := ../plugin.lds
36 OUTPUT = $(OUTDIR)/lua.rock
37 endif
38 else ## simulators
39 OUTPUT = $(OUTDIR)/lua.rock
40 endif
42 all: $(OUTPUT)
44 ifndef APP_TYPE
45 $(OBJDIR)/lua.elf: $(OBJS) $(LINKFILE)
46 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
47 -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/lua.map
49 $(OUTPUT): $(OBJDIR)/lua.elf
50 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
51 else
53 ifdef APP_TYPE
54 ###################################################
55 # This is the SDL simulator version
57 $(OUTPUT): $(OBJS)
58 $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_LDFLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
59 ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
60 # 'x' must be kept or you'll have "Win32 error 5"
61 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
62 # #define ERROR_ACCESS_DENIED 5L
63 else
64 @chmod -x $@
65 endif
67 endif
68 endif # end of simulator section
71 include $(TOOLSDIR)/make.inc
73 # MEMORYSIZE should be passed on to this makefile with the chosen memory size
74 # given in number of MB
75 $(LINKFILE): $(LDS)
76 $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
77 $(DEFINES) -E -P - >$@
79 clean:
80 $(call PRINTS,cleaning lua)rm -rf $(OBJDIR)/lua
81 $(SILENT)rm -f $(OBJDIR)/lua.* $(DEPFILE)
83 -include $(DEPFILE)