source: trunk/core/Makefile @ 1465

Revision 1465, 3.3 KB checked in by philmoz, 18 months ago (diff)

Fix incorrect use of $(EXE) in core/Makefile.

  • Property svn:eol-style set to LF
Line 
1topdir=../
2
3include $(topdir)makefile.inc
4
5CFLAGS+=$(CTHUMB)
6
7# warning: library order matters!
8LDLIBS= -lgcc
9LDOPTS=-nostdlib -Wl,--allow-shlib-undefined -Wl,-T,$(topdir)tools/link-boot.ld
10LDOPTS+=-Wl,-N,-Ttext,$(MEMISOSTART)
11
12all: main.bin
13
14OPT_OBJS=
15ifdef OPT_GAME_REVERSI
16CFLAGS+=-DOPT_GAME_REVERSI
17OPT_OBJS+=gui_reversi.o
18endif
19ifdef OPT_GAME_SOKOBAN
20CFLAGS+=-DOPT_GAME_SOKOBAN
21OPT_OBJS+=gui_sokoban.o
22endif
23ifdef OPT_GAME_CONNECT4
24CFLAGS+=-DOPT_GAME_CONNECT4
25OPT_OBJS+=gui_4wins.o
26endif
27ifdef OPT_GAME_MASTERMIND
28CFLAGS+=-DOPT_GAME_MASTERMIND
29OPT_OBJS+=gui_mastermind.o
30endif
31ifdef OPT_CURVES
32CFLAGS+=-DOPT_CURVES
33OPT_OBJS+=curves.o
34endif
35ifdef OPT_TEXTREADER
36CFLAGS+=-DOPT_TEXTREADER
37OPT_OBJS+=gui_read.o
38endif
39ifdef OPT_CALENDAR
40CFLAGS+=-DOPT_CALENDAR
41OPT_OBJS+=gui_calendar.o
42endif
43ifdef OPT_DEBUGGING
44# global in root makefile.inc
45#CFLAGS+=-DOPT_DEBUGGING
46OPT_OBJS+=gui_debug.o gui_bench.o
47endif
48ifdef OPT_EDGEOVERLAY
49CFLAGS+=-DOPT_EDGEOVERLAY
50OPT_OBJS+=edgeoverlay.o
51endif
52ifdef OPT_MD_DEBUG
53CFLAGS+=-DOPT_MD_DEBUG
54endif
55ifdef OPT_SCRIPTING
56OPT_OBJS+=motion_detector.o script.o
57endif
58ifdef OPT_LUA
59OPT_OBJS+=luascript.o
60endif
61ifdef OPT_LUA_CALL_NATIVE
62CFLAGS+=-DOPT_LUA_CALL_NATIVE
63endif
64ifdef OPT_PTP
65# in top level
66#CFLAGS+=-DOPT_PTP
67OPT_OBJS+=ptp.o
68endif
69ifdef OPT_EXMEM_MALLOC
70#CFLAGS+=-DOPT_EXMEM_MALLOC
71OPT_OBJS+=suba.o
72endif
73
74OBJS=entry.o nothumb.o main.o gui_draw.o gui_menu.o gui_palette.o gui_mbox.o \
75     gui_fselect.o gui.o kbd.o action_stack.o conf.o \
76     histogram.o gui_batt.o gui_space.o gui_osd.o raw.o \
77     gui_usb.o gui_lang.o gui_mpopup.o gui_grid.o raw_merge.o \
78     levent.o shot_histogram.o dng.o bitvector.o console.o $(OPT_OBJS)
79
80gui.o: FORCE
81
82FORCE:
83
84nothumb.o: nothumb.c
85        @echo $< \-\> $@
86        $(CC) $(CFLAGS) -marm -nostdinc -c -o $@ $<
87
88main.bin: main.elf
89        @echo $< \-\> $@
90        $(OBJDUMP) -z -d main.elf > main.dump
91        $(OBJCOPY) -O binary main.elf main.bin
92
93main.elf: $(OBJS) $(topdir)platform/$(PLATFORM)/libplatform.a \
94          $(topdir)platform/$(PLATFORM)/sub/$(PLATFORMSUB)/libplatformsub.a \
95          $(topdir)lib/font/libfont.a $(topdir)lib/math/libmath.a \
96          $(topdir)lib/ubasic/libubasic.a $(topdir)lib/lang/liblang.a \
97          $(topdir)lib/lua/liblua.a \
98          $(topdir)lib/armutil/libarmutil.a
99        @echo \-\> $@
100        $(CC) $(CFLAGS) -o $@ -Wl,--start-group $^  $(LDLIBS) -Wl,--end-group $(LDFLAGS) $(LDOPTS)
101        ( $(NM) $@ | grep ' U ' > $@.syms ) && echo "error: unresolved symbols in $@ (see $@.syms)" && exit 1 || exit 0
102
103        $(SIZE) $@ | tee $(topdir)size.txt
104        @printf " %s-%s (%s, #%s): MEMISOSIZE used: 0x%s\n" \
105   $(PLATFORM) $(PLATFORMSUB) $(PLATFORMOS) $(PLATFORMID) \
106   `tail -c16 $(topdir)size.txt | head -c6` >> $(topdir)bin/caminfo.txt
107        rm -f $(topdir)size.txt
108
109clean:
110        rm -f $(OBJS) main.bin main.elf main.dump main.elf.syms
111
112distclean: clean
113        rm -f $(OBJS:.o=.d)
114
115gui_lang.o: gui_lang.c gui_lang.h gui_lang_str.h
116
117ifdef OPT_DEFAULT_LANG
118gui_lang_str.h: $(topdir)tools/makelang$(EXE) $(topdir)CHDK/LANG/english.lng $(topdir)CHDK/LANG/$(OPT_DEFAULT_LANG).lng
119        @echo $< \-\> $@
120        $(topdir)tools/makelang$(EXE) $(topdir)CHDK/LANG/english.lng $(topdir)CHDK/LANG/$(OPT_DEFAULT_LANG).lng > gui_lang_str.h
121else
122gui_lang_str.h: $(topdir)tools/makelang$(EXE) $(topdir)CHDK/LANG/english.lng
123        @echo $< \-\> $@
124        $(topdir)tools/makelang$(EXE) $(topdir)CHDK/LANG/english.lng > gui_lang_str.h
125endif
126
127include $(topdir)bottom.inc
Note: See TracBrowser for help on using the repository browser.