diff options
Diffstat (limited to 'apps/plugins/clock/Makefile')
-rw-r--r-- | apps/plugins/clock/Makefile | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/apps/plugins/clock/Makefile b/apps/plugins/clock/Makefile new file mode 100644 index 0000000000..0481d3e1c2 --- /dev/null +++ b/apps/plugins/clock/Makefile | |||
@@ -0,0 +1,112 @@ | |||
1 | # __________ __ ___. | ||
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
4 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
6 | # \/ \/ \/ \/ \/ | ||
7 | # $$Id: $$ | ||
8 | # | ||
9 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. -I$(APPSDIR)/plugins/lib \ | ||
11 | $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
12 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \ | ||
13 | -I$(BUILDDIR)/pluginbitmaps | ||
14 | CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ | ||
15 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
16 | |||
17 | ifdef APPEXTRA | ||
18 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
19 | endif | ||
20 | |||
21 | LINKFILE := $(OBJDIR)/link.lds | ||
22 | DEPFILE = $(OBJDIR)/dep-clock | ||
23 | |||
24 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
25 | include $(TOOLSDIR)/makesrc.inc | ||
26 | |||
27 | SOURCES = $(SRC) | ||
28 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
29 | DIRS = . | ||
30 | |||
31 | ifndef SIMVER | ||
32 | LDS := ../plugin.lds | ||
33 | OUTPUT = $(OUTDIR)/clock.rock | ||
34 | else ## simulators | ||
35 | OUTPUT = $(OUTDIR)/clock.rock | ||
36 | endif | ||
37 | |||
38 | all: $(OUTPUT) | ||
39 | |||
40 | ifndef SIMVER | ||
41 | $(OBJDIR)/clock.elf: $(OBJS) $(LINKFILE) $(BITMAPLIBS) | ||
42 | $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \ | ||
43 | $(LINKBITMAPS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/clock.map | ||
44 | |||
45 | $(OUTPUT): $(OBJDIR)/clock.elf | ||
46 | $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ | ||
47 | else | ||
48 | |||
49 | ifeq ($(SIMVER), x11) | ||
50 | ################################################### | ||
51 | # This is the X11 simulator version | ||
52 | |||
53 | $(OUTPUT): $(OBJS) | ||
54 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ | ||
55 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
56 | # 'x' must be kept or you'll have "Win32 error 5" | ||
57 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
58 | # #define ERROR_ACCESS_DENIED 5L | ||
59 | else | ||
60 | @chmod -x $@ | ||
61 | endif | ||
62 | |||
63 | else # end of x11-simulator | ||
64 | ifeq ($(SIMVER), sdl) | ||
65 | ################################################### | ||
66 | # This is the SDL simulator version | ||
67 | |||
68 | $(OUTPUT): $(OBJS) | ||
69 | $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ | ||
70 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
71 | # 'x' must be kept or you'll have "Win32 error 5" | ||
72 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
73 | # #define ERROR_ACCESS_DENIED 5L | ||
74 | else | ||
75 | @chmod -x $@ | ||
76 | endif | ||
77 | |||
78 | else # end of sdl-simulator | ||
79 | ################################################### | ||
80 | # This is the win32 simulator version | ||
81 | DLLTOOLFLAGS = --export-all | ||
82 | DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin | ||
83 | |||
84 | $(OUTPUT): $(OBJS) | ||
85 | $(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS) | ||
86 | $(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \ | ||
87 | $(BUILDDIR)/libplugin.a $(BITMAPLIBS) -o $@ | ||
88 | ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) | ||
89 | # 'x' must be kept or you'll have "Win32 error 5" | ||
90 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
91 | # #define ERROR_ACCESS_DENIED 5L | ||
92 | else | ||
93 | @chmod -x $@ | ||
94 | endif | ||
95 | endif # end of win32-simulator | ||
96 | endif | ||
97 | endif # end of simulator section | ||
98 | |||
99 | |||
100 | include $(TOOLSDIR)/make.inc | ||
101 | |||
102 | # MEMORYSIZE should be passed on to this makefile with the chosen memory size | ||
103 | # given in number of MB | ||
104 | $(LINKFILE): $(LDS) | ||
105 | $(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \ | ||
106 | $(DEFINES) -E -P - >$@ | ||
107 | |||
108 | clean: | ||
109 | $(call PRINTS,cleaning clock)rm -rf $(OBJDIR)/clock | ||
110 | $(SILENT)rm -f $(OBJDIR)/clock.* $(DEPFILE) | ||
111 | |||
112 | -include $(DEPFILE) | ||