rm unused file
[picodrive.git] / platform / uiq3 / uiq3.mak
... / ...
CommitLineData
1#######################################################################
2### App specific part - this must be defined
3#NAME="AnimatedStereogram"
4#VENDOR="Pal Szasz"
5#UID2=100039CE
6#UID3=E0004201
7#EPOCLIBS="euser.lib apparc.lib cone.lib eikcore.lib eikcoctl.lib qikcore.lib fbscli.lib estlib.lib"
8#EPOCROOT=/opt/space/uiq3/
9#######################################################################
10
11APPNAME ?= "UIQ3 Program"
12VENDOR ?= "Somebody"
13UID2 ?= 100039CE
14UID3 ?= E0001001
15VER_MAJ ?= 1
16VER_MIN ?= 0
17STACK ?= 0x1000
18HEAP ?= 0x1000,0x100000
19EPOCROOT ?= /opt/space/uiq3/
20GCCPREF ?= arm-none-symbianelf
21GCCPATH ?= $(EPOCROOT)/gcc
22GCCVER ?= 3.4.3
23
24export EPOCROOT
25
26NAME_ := $(shell echo $(APPNAME) | sed 's: ::g')
27NAME := $(shell perl -e "print lc(\"$(NAME_)\")")
28EPOCLIBS += euser.lib apparc.lib cone.lib eikcore.lib eikcoctl.lib qikcore.lib fbscli.lib estlib.lib qikallocdll.lib
29EPOCREL = $(EPOCROOT)/epoc32/release/armv5
30CC = $(GCCPREF)-gcc
31CXX = $(GCCPREF)-g++
32AS = $(GCCPREF)-as
33LD = $(GCCPREF)-ld
34ELF2E32 = elf2e32
35BMCONV = bmconv
36EPOCRC = EPOCROOT=$(EPOCROOT) epocrc
37
38PATH := $(EPOCROOT)/bin:$(GCCPATH)/bin:$(PATH)
39
40# -march=armv5t ?
41CFLAGS += -Wall -pipe -nostdinc -msoft-float
42CFLAGS += -DNDEBUG -D_UNICODE -D__GCCE__ -D__SYMBIAN32__ -D__EPOC32__ -D__MARM__
43CFLAGS += -D__EABI__ -D__MARM_ARMV5__ -D__EXE__ -D__SUPPORT_CPP_EXCEPTIONS__ -D__MARM_ARMV5__
44CFLAGS += -D__PRODUCT_INCLUDE__="$(EPOCROOT)/epoc32/include/variant/uiq_3.0.hrh"
45CFLAGS += -include $(EPOCROOT)/epoc32/include/gcce/gcce.h
46CFLAGS += -I$(EPOCROOT)/epoc32/include -I$(EPOCROOT)/epoc32/include/libc \
47 -I$(EPOCROOT)/epoc32/include/variant -I$(GCCPATH)/lib/gcc/arm-none-symbianelf/$(GCCVER)/include/
48# can't optimize .cpp without -fno-unit-at-a-time
49CXXFLAGS += $(CFLAGS) -c -x c++ -mapcs -Wno-ctor-dtor-privacy -Wno-unknown-pragmas -fexceptions -fno-unit-at-a-time
50
51LDFLAGS += -L$(GCCPATH)/lib -L$(GCCPATH)/lib/gcc/$(GCCPREF)/$(GCCVER) -L $(GCCPATH)/$(GCCPREF)/lib
52LDFLAGS += --target1-abs --no-undefined -nostdlib -shared
53LDFLAGS += -Ttext 0x8000 -Tdata 0x400000 --default-symver
54LDFLAGS += -soname $(NAME){000a0000}\[$(UID3)\].exe --entry _E32Startup -u _E32Startup
55LDFLAGS += $(EPOCROOT)/epoc32/release/armv5/urel/eexe.lib
56LDFLAGS += -o $(NAME).elf.exe -Map $(NAME).exe.map
57LDFLAGS2 = $(EPOCREL)/urel/qikalloc.lib $(EPOCREL)/lib/euser.dso
58LDFLAGS2 += $(shell for i in $(EPOCLIBS); do echo -n " $(EPOCREL)/lib/$${i%%.lib}.dso "; done)
59LDFLAGS2 += $(EPOCREL)/urel/usrt2_2.lib
60LDFLAGS2 += $(shell for i in dfpaeabi dfprvct2_2 drtaeabi scppnwdl drtrvct2_2; do echo -n " $(EPOCREL)/lib/$$i.dso "; done)
61LDFLAGS2 += -lsupc++ -lgcc
62
63E32FLAGS += --sid=0x$(UID3) --uid1=0x1000007a --uid2=0x$(UID2) --uid3=0x$(UID3)
64E32FLAGS += --capability=none --fpu=softvfp --targettype=EXE
65E32FLAGS += --output=$(NAME).exe --elfinput=$(NAME).elf.exe
66E32FLAGS += --stack=$(STACK)
67E32FLAGS += --heap=$(HEAP)
68E32FLAGS += --linkas=$(NAME){000a0000}[$(UID3)].exe --libpath=$(EPOCREL)/lib
69
70EPOCRCFLAGS += -I../inc -I- -I$(EPOCROOT)/epoc32/include -I$(EPOCROOT)/epoc32/include/variant -DLANGUAGE_SC
71
72ICONS ?= $(shell echo ../data/appicon/*.bmp)
73APPICON ?= $(NAME)appicon.mbm
74RSCDIR ?= ../rsc
75REGDIR ?= ../reg
76
77SRCH += $(shell echo ../inc/*.h)
78SRC += $(shell echo ../src/*.cpp)
79SRCRES ?= $(shell echo $(RSCDIR)/*.rss $(RSCDIR)/*.rls $(REGDIR)/*.rss $(REGDIR)/*.rls)
80OBJS ?= $(SRC:.cpp=.o)
81
82.PHONY : all mbm icon_mbm rsc reg loc bin sis run
83
84#all : sis
85
86sis : $(NAME).sis
87
88icon_mbm : $(APPICON)
89
90mbm :
91
92$(NAME)appicon.mbg $(NAME)appicon.mbm : $(ICONS)
93 @echo "Creating multibitmap file..."
94 $(BMCONV) /h$(NAME)appicon.mbg $(NAME)appicon.mbm \
95 /c24../data/appicon/icon_small.bmp\
96 /8../data/appicon/icon_small_mask.bmp\
97 /c24../data/appicon/icon_large.bmp\
98 /8../data/appicon/icon_large_mask.bmp\
99 /c24../data/appicon/icon_xlarge.bmp\
100 /8../data/appicon/icon_xlarge_mask.bmp
101
102rsc : $(RSCDIR)/$(NAME).rsc
103
104$(RSCDIR)/$(NAME).rsc : $(RSCDIR)/$(NAME).rss # $(RSCDIR)/$(NAME).rls
105 @echo "Creating $@ ..."
106 $(EPOCRC) $(EPOCRCFLAGS) -I$(RSCDIR) -u $(RSCDIR)/$(NAME).rss \
107 -o$(RSCDIR)/$(NAME).rsc -h$(RSCDIR)/$(NAME).rsg -t/tmp -l$(RSCDIR)
108
109reg : $(REGDIR)/$(NAME)_reg.rsc
110
111$(REGDIR)/$(NAME)_reg.rsc : $(REGDIR)/$(NAME)_reg.rss
112 @echo "Creating $@ ..."
113 RC_UID2=0x101f8021 RC_UID3=0x$(UID3) $(EPOCRC) $(EPOCRCFLAGS) -I$(REGDIR) \
114 -u $(REGDIR)/$(NAME)_reg.rss -o$(REGDIR)/$(NAME)_reg.rsc -h$(REGDIR)/$(NAME)_reg.rsg -t/tmp -l$(REGDIR)
115
116loc : $(REGDIR)/$(NAME)_loc.rsc
117
118$(REGDIR)/$(NAME)_loc.rsc : $(REGDIR)/$(NAME)_loc.rss
119 @echo "Creating $@ ..."
120 $(EPOCRC) $(EPOCRCFLAGS) -I$(REGDIR) \
121 -u $(REGDIR)/$(NAME)_loc.rss -o$(REGDIR)/$(NAME)_loc.rsc -h$(REGDIR)/$(NAME)_loc.rsg -t/tmp -l$(REGDIR)
122
123bin : bin_elf
124 @echo "Elf -> E32"
125 $(ELF2E32) $(E32FLAGS)
126
127bin_elf : $(NAME).elf.exe
128
129$(NAME).elf.exe : $(OBJS) $(EXTRALIB)
130 @echo "Linking..."
131 $(LD) $(LDFLAGS) $(OBJS) $(EXTRALIB) $(LDFLAGS2)
132
133.cpp.o :
134 @echo "Compiling $< ..."
135 $(CXX) $(CXXFLAGS) -o $@ $<
136
137$(NAME).sis : icon_mbm mbm rsc reg loc bin
138 rm -f $(NAME).sis
139 makesis $(NAME).pkg
140 mv $(NAME).SIS $(NAME).sis
141
142#cat $(EPOCROOT)/extra/in.pkg extra.pkg | \
143# sed "s:APPNAME:$(APPNAME):g" | \
144# sed "s:NAME:$(NAME):g" | \
145# sed "s:VER_MAJ:$(VER_MAJ):g" | \
146# sed "s:VER_MIN:$(VER_MIN):g" | \
147# sed "s:UID3:$(UID3):g" | \
148# sed "s:VENDOR:$(VENDOR):g" > $(NAME).pkg
149
150run : sis
151 xterm -e "to-phone m600 $(NAME).sis"
152
153-include .deps
154
155.deps : $(SRC) $(SRCH)
156 echo > $@
157 $(CXX) -M -DDEPS $(SRC) $(CXXFLAGS) >> $@
158
159clean :
160 rm -f $(NAME).exe $(NAME).elf.exe $(OBJS) tags .deps $(NAME).exe.map
161 rm -f *.bkp ../src/*.bkp ../inc/*.bkp $(RSCDIR)/*.bkp $(REGDIR)/*.bkp
162 rm -f $(RSCDIR)/*.rsc $(RSCDIR)/*.rsg
163 rm -f $(REGDIR)/*.rsc $(REGDIR)/*.rsg
164 rm -f $(APPICON) $(NAME)appicon.mbg $(NAME).mbg
165
166