diff options
Diffstat (limited to 'apps/plugins/lua/Makefile')
-rw-r--r-- | apps/plugins/lua/Makefile | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/apps/plugins/lua/Makefile b/apps/plugins/lua/Makefile new file mode 100644 index 0000000000..d2a40d38ad --- /dev/null +++ b/apps/plugins/lua/Makefile | |||
@@ -0,0 +1,86 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # | ||
8 | OPT_FLAGS=-O0 | ||
9 | |||
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) | ||
14 | |||
15 | ifdef APPEXTRA | ||
16 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
17 | endif | ||
18 | |||
19 | LINKFILE := $(OBJDIR)/link.lds | ||
20 | DEPFILE = $(OBJDIR)/dep-lua | ||
21 | |||
22 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
23 | include $(TOOLSDIR)/makesrc.inc | ||
24 | |||
25 | SOURCES = $(SRC) | ||
26 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
27 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
28 | DIRS = . | ||
29 | |||
30 | ifndef SIMVER | ||
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 | ||
41 | |||
42 | all: $(OUTPUT) | ||
43 | |||
44 | ifndef SIMVER | ||
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 | ||
48 | |||
49 | $(OUTPUT): $(OBJDIR)/lua.elf | ||
50 | $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ | ||
51 | else | ||
52 | |||
53 | ifeq ($(SIMVER), sdl) | ||
54 | ################################################### | ||
55 | # This is the SDL simulator version | ||
56 | |||
57 | $(OUTPUT): $(OBJS) | ||
58 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(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 | ||
66 | |||
67 | endif | ||
68 | endif # end of simulator section | ||
69 | |||
70 | |||
71 | include $(TOOLSDIR)/make.inc | ||
72 | |||
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 - >$@ | ||
78 | ./action_helper.pl > actions.lua | ||
79 | echo $(pwd) | ||
80 | |||
81 | clean: | ||
82 | $(call PRINTS,cleaning lua)rm -rf $(OBJDIR)/lua | ||
83 | $(SILENT)rm -f $(OBJDIR)/lua.* $(DEPFILE) | ||
84 | |||
85 | -include $(DEPFILE) | ||
86 | |||