1 ## Palm OS Protein Generic Makefile Engine for Eclipse v1.0.0
5 # This makefile engine is capable of compiling Protein
6 # applications for Palm OS.
8 # This makefile engine assumes that the following variables are
9 # set outside of this makefile by a referencing master makefile
10 # (see a master makefile generated by a Palm OS Developer
11 # Suite wizard for detailed explanation of each variable):
28 # ADDITIONAL_LINK_LIBRARIES
29 # ADDITIONAL_SIM_LINK_LIBRARIES
31 # LOCAL_SIM_INCLUDE_PATHS
32 # SYSTEM_INCLUDE_PATHS
33 # SYSTEM_SIM_INCLUDE_PATHS
36 # ADDITIONAL_COMPILER_FLAGS
37 # ADDITIONAL_SIM_COMPILER_FLAGS
38 # ADDITIONAL_LINKER_FLAGS
39 # ADDITIONAL_SIM_LINKER_FLAGS
41 # ADDITIONAL_SIM_AR_FLAGS
48 # Additionally, the user of this makefile engine may obtain the
53 # by doing an optional include of a makefile segment that is
54 # generated during the Palm OS Developer Suite standard make build.
55 # The makefile line to accomplish this is:
56 # -include auto-generated.mk
57 # All master makefiles generated by Palm OS Developer Suite
58 # wizards include this line already to pick up and use these
59 # dynamic definitions.
61 # All variable values may be overridden by editing the make command
62 # for the project (Project->Properties->C/C++ Make Project->Make Builder,
63 # Build Command field).
66 ###############################################################################
75 # Locale (defaults to English)
80 ifeq ($(CREATOR_ID), )
92 ifeq ($(DEBUG_DEVICE_OUTPUT_DIR), )
93 DEBUG_DEVICE_OUTPUT_DIR = DebugDevice
96 ifeq ($(RELEASE_DEVICE_OUTPUT_DIR), )
97 RELEASE_DEVICE_OUTPUT_DIR = ReleaseDevice
100 ifeq ($(DEBUG_SIMULATOR_OUTPUT_DIR), )
101 DEBUG_SIMULATOR_OUTPUT_DIR = DebugSim
104 ifeq ($(RELEASE_SIMULATOR_OUTPUT_DIR), )
105 RELEASE_SIMULATOR_OUTPUT_DIR = ReleaseSim
108 ifeq ($(SDK_VERSION), )
112 ifeq ($(ENABLE_EXCEPTIONS), )
113 ENABLE_EXCEPTIONS=TRUE
116 ###############################################################################
117 # App/PRC/Database Names
119 # The difference between App Name and Database name is that App Name may
120 # contain spaces while the database name is the App name with spaces removed.
121 # (Coded in such a way that if the user already explicitly defined these
122 # variables previously, we'll go with those).
124 ifeq ($(DATABASE_NAME), )
125 ifeq ($(ESCAPED_ARTIFACT_NAME), )
126 # Database name defaults if ARTIFACT_NAME is empty
127 DATABASE_NAME = StartApp
129 DATABASE_NAME = $(ESCAPED_ARTIFACT_NAME)
134 ifeq ($(ESCAPED_ARTIFACT_NAME), )
135 # PRC name defaults if ESCAPED_ARTIFACT_NAME is empty
138 PRC_NAME = $(DATABASE_NAME).prc
143 ifeq ($(ESCAPED_ARTIFACT_NAME), )
144 # LIB name defaults if ESCAPED_ARTIFACT_NAME is empty
147 LIB_NAME = $(DATABASE_NAME).a
151 ifeq ($(SIM_LIB_NAME), )
152 ifeq ($(ESCAPED_ARTIFACT_NAME), )
153 # SIM LIB name defaults if ESCAPED_ARTIFACT_NAME is empty
154 SIM_LIB_NAME = Start.lib
156 SIM_LIB_NAME = $(DATABASE_NAME).lib
160 ###############################################################################
161 # Compile and Link Settings
163 TARGET_FORMAT=PalmOS6
165 # Compiler settings... compiler + optimizations + debug
166 # This is a makefile for Palm OS 6 so the compilers used are as follows:
167 # Device target compiler is pacc
168 # Simulator target compiler is gcc
170 CC = "$(TOOLS_DIR)pacc"
173 CFLAGS += -D__PALMOS_KERNEL__=1 -D__PALMOS__=0x06000000
174 SIM_CFLAGS += -fexceptions -mno-cygwin -mwindows -D__PALMOS_KERNEL__=1 -D__PALMOS__=0x06000000 -D_SUPPORTS_NAMESPACE=0 -D_SUPPORTS_RTTI=1 -DTARGET_PLATFORM=TARGET_PLATFORM_PALMSIM_WIN32 -DTARGET_HOST=TARGET_HOST_PALMOS
176 # Warning level for device target
177 ifeq ($(WARNING_LEVEL), ALL)
180 ifeq ($(WARNING_LEVEL), SOME)
183 ifeq ($(WARNING_LEVEL), NONE)
189 # Warning level for simulator target
190 ifeq ($(SIM_WARNING_LEVEL), ALL)
193 ifeq ($(SIM_WARNING_LEVEL), NONE)
198 # Warnings as errors for device builds
199 ifeq ($(WARNING_AS_ERROR), TRUE)
203 # Warnings as errors for simulator builds
204 ifeq ($(SIM_WARNING_AS_ERROR), TRUE)
205 SIM_CFLAGS += -Werror
208 # Adding after other warnings flags so this is always in effect
209 SIM_CFLAGS += -Wno-multichar
211 # Verbose output for device build
212 ifeq ($(VERBOSE), TRUE)
216 # Verbose output for simulator build
217 ifeq ($(SIM_VERBOSE), TRUE)
222 ifeq ($(ARM_LOGO), TRUE)
228 # Exception handling support
229 ifeq ($(ENABLE_EXCEPTIONS), TRUE)
234 # Assertion handling support
235 ifeq ($(ENABLE_ASSERTIONS), TRUE)
241 # Additional linker flags
242 ifdef ADDITIONAL_PALINK_FLAGS
243 LDFLAGS += $(ADDITIONAL_PALINK_FLAGS)
246 # Optimization settings
247 ifeq ($(OPTIMIZE_LEVEL), INLINING)
249 SIM_OPTIMIZER_FLAG = -O3
251 ifeq ($(OPTIMIZE_LEVEL), INTERPROCEDURAL)
253 SIM_OPTIMIZER_FLAG = -O3
255 ifeq ($(OPTIMIZE_LEVEL), FULL)
257 SIM_OPTIMIZER_FLAG = -O3
259 ifeq ($(OPTIMIZE_LEVEL), INTRAPROCEDURAL)
261 SIM_OPTIMIZER_FLAG = -O3
263 ifeq ($(OPTIMIZE_LEVEL), SOME)
265 SIM_OPTIMIZER_FLAG = -O1
267 ifeq ($(OPTIMIZE_LEVEL), NONE)
269 SIM_OPTIMIZER_FLAG = -O0
271 # Default to 0 for debug, 3 for release
272 ifeq ($(DEBUG_OR_RELEASE), Debug)
274 SIM_OPTIMIZER_FLAG = -O0
277 SIM_OPTIMIZER_FLAG = -O3
286 # Debug settings (can override optimize settings)
287 ifeq ($(DEBUG_OR_RELEASE), Debug)
289 BUILD_TYPE_FLAG = -DBUILD_TYPE=BUILD_TYPE_DEBUG
290 TRACE_OUTPUT_FLAG = -DTRACE_OUTPUT=TRACE_OUTPUT_ON
292 BUILD_TYPE_FLAG = -DBUILD_TYPE=BUILD_TYPE_RELEASE
293 TRACE_OUTPUT_FLAG = -DTRACE_OUTPUT=TRACE_OUTPUT_OFF
296 ifeq ($(DEBUG_OR_RELEASE), Debug)
297 OBJ_DIR = $(DEBUG_DEVICE_OUTPUT_DIR)
298 SIM_OBJ_DIR = $(DEBUG_SIMULATOR_OUTPUT_DIR)
300 OBJ_DIR = $(RELEASE_DEVICE_OUTPUT_DIR)
301 SIM_OBJ_DIR = $(RELEASE_SIMULATOR_OUTPUT_DIR)
305 CFLAGS += $(OPTIMIZER_FLAG) $(DEBUG_FLAG) $(BUILD_TYPE_FLAG) $(TRACE_OUTPUT_FLAG)
306 SIM_CFLAGS += $(SIM_OPTIMIZER_FLAG) $(DEBUG_FLAG) $(BUILD_TYPE_FLAG) $(TRACE_OUTPUT_FLAG)
308 # Linker settings (must come after setting DEBUG_FLAG)
309 LD = "$(TOOLS_DIR)pacc"
312 LDFLAGS += $(DEBUG_FLAG) -nologo -Wl,-nolocals
313 SIM_LDFLAGS += $(DEBUG_FLAG) -mno-cygwin -mwindows $(SIM_OBJ_DIR)/gcc_link.def -shared -nostdlib -u___divdi3 -u___moddi3 -u___udivdi3 -u___umoddi3
314 SIM_LIBS = -L "$(TOOLS_DIR)misclibs" -lpxstlport -lpxsupc++ -lpxgcc -lgcc
315 ifeq ($(DEBUG_OR_RELEASE), Debug)
316 LDFLAGS += -Wl,-debug -Wl,-libpath -Wl,"$(SDK_LOCATION)libraries/ARM_4T/Debug/Default"
317 SIM_LIBS += "$(SDK_LOCATION)libraries/Simulator/Debug/PalmOS.lib"
319 LDFLAGS += -Wl,-libpath -Wl,"$(SDK_LOCATION)libraries/ARM_4T/Release/Default"
320 SIM_LIBS += "$(SDK_LOCATION)libraries/Simulator/Release/PalmOS.lib"
323 LDOBJS = PalmOS.a SystemGlue.a FloatMgr.sa
325 ifeq ($(TARGET_PLATFORM), Device)
326 NATIVE_OBJ_DIR := $(OBJ_DIR)
327 RSC_OBJ_DIR := $(OBJ_DIR)
329 NATIVE_OBJ_DIR := $(SIM_OBJ_DIR)
330 RSC_OBJ_DIR := $(SIM_OBJ_DIR)
334 AR="$(TOOLS_DIR)palib"
340 LINKER_OUTPUT := $(OBJ_DIR)/$(DATABASE_NAME).axf
341 SIM_LINKER_OUTPUT := $(SIM_OBJ_DIR)/$(DATABASE_NAME).dll
343 TARGET := $(OBJ_DIR)/$(PRC_NAME)
344 SIM_TARGET := $(SIM_OBJ_DIR)/$(PRC_NAME)
346 STATIC_LIB_TARGET := $(OBJ_DIR)/$(LIB_NAME)
347 SIM_STATIC_LIB_TARGET := $(SIM_OBJ_DIR)/$(SIM_LIB_NAME)
349 ###############################################################################
350 # Resource flags (PalmRC)
354 # Default text encoding is Latin
355 ifeq ($(PRC_TEXT_ENCODING), )
356 PRC_TEXT_ENCODING = LATIN
359 ifeq ($(PRC_TEXT_ENCODING), LATIN)
360 RFLAGS += -target 4.0
362 ifeq ($(PRC_TEXT_ENCODING), JAPANESE)
363 RFLAGS += -target 4.0J
365 ifeq ($(PRC_TEXT_ENCODING), SIMPLIFIED_CHINESE)
366 RFLAGS += -target 4.0CS
371 ifeq ($(PRC_NO_LOCALE_CHECK), TRUE)
372 RFLAGS += -noLocaleCheck
375 ifeq ($(PRC_STRICT_LOCALE), TRUE)
376 RFLAGS += -strictLocale
379 ifeq ($(PRC_STRICT_ENCODING), TRUE)
380 RFLAGS += -strictTextEncoding
383 ifdef PRC_OVERLAY_FILTER
384 RFLAGS += -overlayFilter $(PRC_OVERLAY_FILTER)
387 ifeq ($(PRC_NO_WARN_SIZE), TRUE)
388 RFLAGS += -noWarnSize
391 ifeq ($(PRC_QUIET), TRUE)
395 ifeq ($(PRCMERGE_QUIET), TRUE)
399 ###############################################################################
401 # function for converting sources to object file names in one of output directories
402 define SOURCE_LIST_TO_OBJS
403 $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
404 $(basename $(notdir $(file))))))
407 # function for converting sources to object file names in $(SIM_OBJ_DIR)
408 define SOURCE_LIST_TO_SIM_OBJS
409 $(addprefix $(SIM_OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
410 $(basename $(notdir $(file))))))
413 # function for converting resources into resource object files
414 define RESOURCE_LIST_TO_OBJS
415 $(addprefix $(RSC_OBJ_DIR)/, $(addsuffix .trc, $(foreach file, $(RESOURCES), \
416 $(basename $(file)))))
419 OBJS = $(SOURCE_LIST_TO_OBJS)
420 SIM_OBJS = $(SOURCE_LIST_TO_SIM_OBJS)
421 SOURCE_PATHS += $(sort $(foreach file, $(SOURCES), $(dir $(file))))
422 RESOURCE_OBJS = $(RESOURCE_LIST_TO_OBJS)
423 RESOURCE_PATHS += $(sort $(foreach file, $(RESOURCES), $(dir $(file))))
424 SLD_BASENAME := $(addsuffix _Startup, $(basename $(notdir $(SLD_FILE))))
425 SLD_OBJ := $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(SLD_BASENAME)))
426 SLD_SIM_OBJ := $(addprefix $(SIM_OBJ_DIR)/, $(addsuffix .o, $(SLD_BASENAME)))
429 VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SOURCE_PATHS) $(RESOURCE_PATHS) )))
431 SYSTEM_INCLUDES = $(SYSTEM_INCLUDE_PATHS) -I "$(SDK_LOCATION)headers" -I "$(SDK_LOCATION)headers/posix"
432 INCLUDES = $(LOCAL_INCLUDE_PATHS) $(foreach path, $(SOURCE_PATHS), $(addprefix -I, $(path))) $(SYSTEM_INCLUDES) $(PRE_INCLUDE_PATHS)
433 CPP_INCLUDES = -I "$(TOOLS_DIR)include/stlport"
435 SIM_SYSTEM_INCLUDES = $(SYSTEM_SIM_INCLUDE_PATHS) -I "$(SDK_LOCATION)headers" -I "$(SDK_LOCATION)headers/posix"
436 SIM_INCLUDES = $(LOCAL_SIM_INCLUDE_PATHS) $(foreach path, $(SOURCE_PATHS), $(addprefix -I, $(path))) $(SIM_SYSTEM_INCLUDES) $(SIM_PRE_INCLUDE_PATHS)
437 SIM_CPP_INCLUDES = -I "$(TOOLS_DIR)include/stlport"
439 # Now add additional settings specified by user
440 LDFLAGS += $(ADDITIONAL_LINK_LIBRARIES)
441 LDFLAGS += $(foreach libpath, $(ADDITIONAL_LINK_LIBPATH), $(addprefix -libpath , $(libpath)))
442 LDFLAGS += $(foreach option, $(ADDITIONAL_LINKER_FLAGS), $(addprefix -Wl$(comma), $(option)))
443 CFLAGS += $(foreach define, $(DEFINES), $(addprefix -D, $(define)))
444 CFLAGS += $(foreach define, $(UNDEFINES), $(addprefix -U, $(define)))
445 CFLAGS += $(ADDITIONAL_COMPILER_FLAGS)
447 SIM_LDFLAGS += $(ADDITIONAL_SIM_LINK_LIBRARIES)
448 SIM_LDFLAGS += $(ADDITIONAL_SIM_LINKER_FLAGS)
449 SIM_LDFLAGS += $(foreach libpath, $(ADDITIONAL_SIM_LINK_LIBPATH), $(addprefix -L, $(libpath)))
450 SIM_CFLAGS += $(foreach define, $(SIM_DEFINES), $(addprefix -D, $(define)))
451 SIM_CFLAGS += $(foreach define, $(SIM_UNDEFINES), $(addprefix -U, $(define)))
452 SIM_CFLAGS += $(ADDITIONAL_SIM_COMPILER_FLAGS)
454 # Specifyc additional archival flags (for static libraries)
455 ARFLAGS += $(ADDITIONAL_AR_FLAGS)
456 SIM_ARFLAGS += $(ADDITIONAL_SIM_AR_FLAGS)
458 RFLAGS += $(ADDITIONAL_PRC_FLAGS)
459 PRCFLAGS += $(ADDITIONAL_PRCMERGE_FLAGS)
461 ###############################################################################
462 # Flags for PRC creation
464 PRCFLAGS += -dbFlagExtendedDB -dbFlagExecutable
466 PRCFLAGS += -dbVersion $(DATABASE_VERSION) $(DATABASE_PROTECT) $(DATABASE_HIDDEN) $(DATABASE_BACKUP) $(DATABASE_RESET) $(DATABASE_BUNDLE)
469 ###############################################################################
473 PSLIB_SIM_FLAGS = -outSimgcc
474 ifeq ($(PROJECT_TYPE), slib)
475 PSLIB_DEV_FLAGS += -outEntryNums $(OBJ_DIR)/$(DATABASE_NAME)_Client.h -outObjStubs $(OBJ_DIR)/$(DATABASE_NAME)_Client.sa
476 PSLIB_SIM_FLAGS += -outEntryNums $(SIM_OBJ_DIR)/$(DATABASE_NAME)_Client.h -outSimStubs $(SIM_OBJ_DIR)/$(DATABASE_NAME)_Client.slib
481 ###############################################################################
482 # Project make target determination
484 ifeq ($(TARGET_PLATFORM), Device)
486 ifeq ($(PROJECT_TYPE), )
487 PROJECT_TARGET = device
490 ifeq ($(PROJECT_TYPE), appl)
491 PROJECT_TARGET = device
493 ifeq ($(PROJECT_TYPE), slib)
494 PROJECT_TARGET = device_shared_lib
496 ifeq ($(PROJECT_TYPE), lib)
497 PROJECT_TARGET = device_static_lib
502 ifeq ($(PROJECT_TYPE), )
503 PROJECT_TARGET = simulator
506 ifeq ($(PROJECT_TYPE), appl)
507 PROJECT_TARGET = simulator
509 ifeq ($(PROJECT_TYPE), slib)
510 PROJECT_TARGET = simulator_shared_lib
512 ifeq ($(PROJECT_TYPE), lib)
513 PROJECT_TARGET = simulator_static_lib
518 ###############################################################################
519 # Eclipse requires an all target to get the work done
521 all: $(PROJECT_TARGET)
523 # This rule is only valid for projects created as application projects.
524 # Don't invoke this make target directly; instead change the value of
525 # TARGET_PLATFORM to Device in the main makefile
526 device: $(OBJ_DIR) $(TARGET)
528 # This rule is only valid for projects created as application projects.
529 # Don't invoke this make target directly; instead change the value of
530 # TARGET_PLATFORM to Simulator in the main makefile
531 simulator: $(SIM_OBJ_DIR) $(SIM_TARGET)
533 # This rule is only valid for projects created as shared library projects.
534 # Don't invoke this make target directly; instead change the value of
535 # TARGET_PLATFORM to Device in the main makefile
536 device_shared_lib: $(OBJ_DIR) $(TARGET)
538 # This rule is only valid for projects created as shared library projects.
539 # Don't invoke this make target directly; instead change the value of
540 # TARGET_PLATFORM to Simulator in the main makefile
541 simulator_shared_lib: $(SIM_OBJ_DIR) $(SIM_TARGET)
543 # This rule is only valid for projects created as static library projects.
544 # Don't invoke this make target directly; instead change the value of
545 # TARGET_PLATFORM to Device in the main makefile
546 device_static_lib: $(OBJ_DIR) $(STATIC_LIB_TARGET)
548 # This rule is only valid for projects created as static library projects.
549 # Don't invoke this make target directly; instead change the value of
550 # TARGET_PLATFORM to Simulator in the main makefile
551 simulator_static_lib: $(SIM_OBJ_DIR) $(SIM_STATIC_LIB_TARGET)
554 # rule to create the object file directories if needed
556 @[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
559 @[ -d $(SIM_OBJ_DIR) ] || mkdir $(SIM_OBJ_DIR) > /dev/null 2>&1
562 $(OBJ_DIR)/%.o : %.c makefile
563 $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@
564 $(OBJ_DIR)/%.o : %.cpp makefile
565 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
566 $(OBJ_DIR)/%.o : %.cp makefile
567 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
568 $(OBJ_DIR)/%.o : %.cc makefile
569 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
570 $(OBJ_DIR)/%.o : %.C makefile
571 $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@
572 $(OBJ_DIR)/%.o : %.CC makefile
573 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
574 $(OBJ_DIR)/%.o : %.CPP makefile
575 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
577 # Simulator C/C++ sources
578 $(SIM_OBJ_DIR)/%.o : %.c makefile
579 $(SIM_CC) -c $< $(SIM_INCLUDES) -std=c99 $(SIM_CFLAGS) -o $@
580 $(SIM_OBJ_DIR)/%.o : %.cpp makefile
581 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
582 $(SIM_OBJ_DIR)/%.o : %.cp makefile
583 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
584 $(SIM_OBJ_DIR)/%.o : %.cc makefile
585 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
586 $(SIM_OBJ_DIR)/%.o : %.C makefile
587 $(SIM_CC) -c $< $(SIM_INCLUDES) -std=c99 $(SIM_CFLAGS) -o $@
588 $(SIM_OBJ_DIR)/%.o : %.CC makefile
589 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
590 $(SIM_OBJ_DIR)/%.o : %.CPP makefile
591 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
594 # XRD source processing
595 $(RSC_OBJ_DIR)/%.trc : %.xrd makefile
596 "$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) -makeDeps $(@D)/$(*F).deps $(RFLAGS) -locale $(LOCALE) "`cygpath -w -a ./$<`" -o $@
597 $(RSC_OBJ_DIR)/%.trc : %.XRD makefile
598 "$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) -makeDeps $(@D)/$(*F).deps $(RFLAGS) -locale $(LOCALE) "`cygpath -w -a ./$<`" -o $@
601 # Definition file source processing
602 $(SLD_OBJ) : makefile
603 @echo "...Processing definition file for Device..."
604 "$(TOOLS_DIR)pslib" -inDef "$(SLD_FILE)" $(PSLIB_DEV_FLAGS) -outObjStartup $@ -type '$(DB_TYPE)' -creator '$(CREATOR_ID)' -execName $(DATABASE_NAME)
606 $(SLD_SIM_OBJ) : makefile
607 @echo "...Processing definition file for Simulator..."
608 "$(TOOLS_DIR)pslib" -inDef "$(SLD_FILE)" $(PSLIB_SIM_FLAGS) -outSimStartup $@ -outSimRsrc $(SIM_OBJ_DIR)/acod0000.bin -outSimDefs $(SIM_OBJ_DIR)/gcc_link.def -type '$(DB_TYPE)' -creator '$(CREATOR_ID)' -execName $(DATABASE_NAME)
611 $(LINKER_OUTPUT) : $(OBJS)
612 @echo "...Linking for Device Target..."
613 $(LD) -o $(LINKER_OUTPUT) $(OBJS) $(SLD_OBJ) $(LDOBJS) $(LDFLAGS)
615 $(SIM_LINKER_OUTPUT) : $(SIM_OBJS)
616 @echo "...Linking for Simulator Target..."
617 $(SIM_LD) --entry 0 -o $(SIM_LINKER_OUTPUT) $(SIM_OBJS) $(SLD_SIM_OBJ) $(SIM_LDFLAGS) $(SIM_LIBS)
620 # Final target creation
621 $(TARGET): $(SLD_OBJ) $(LINKER_OUTPUT) $(RESOURCE_OBJS)
622 @echo "...Creating PRC for Device: $(TARGET)"
623 "$(TOOLS_DIR)pelf2bin" -format 6 -directory $(OBJ_DIR) -code acod -data adat -rsrc 0x0000 $(LINKER_OUTPUT)
624 "$(TOOLS_DIR)PRCMerge" -dbType '$(DB_TYPE)' -dbCreator '$(CREATOR_ID)' -dbName $(DATABASE_NAME) $(PRCFLAGS) -o $(TARGET) $(RESOURCE_OBJS) $(OBJ_DIR)/adat0000.bin $(OBJ_DIR)/acod0000.bin
625 @echo ...Done with Device build...
628 $(SIM_TARGET): $(SLD_SIM_OBJ) $(SIM_LINKER_OUTPUT) $(RESOURCE_OBJS)
629 @echo "...Creating PRC for Simulator: $(SIM_TARGET)"
630 cp -f "$(SDK_LOCATION)misctools/Resources/amdd_fake" $(SIM_OBJ_DIR)/adat0000.bin
631 "$(TOOLS_DIR)PRCMerge" -dbType '$(DB_TYPE)' -dbCreator '$(CREATOR_ID)' -dbName $(DATABASE_NAME) $(PRCFLAGS) -o $(SIM_TARGET) $(RESOURCE_OBJS) $(SIM_OBJ_DIR)/adat0000.bin $(SIM_OBJ_DIR)/acod0000.bin
632 @echo ...Done with Simulator build...
635 $(STATIC_LIB_TARGET) : $(OBJS)
636 @echo "...Linking Static Library for Device Target..."
637 $(AR) $(ARFLAGS) $(STATIC_LIB_TARGET) $(OBJS)
639 $(SIM_STATIC_LIB_TARGET) : $(SIM_OBJS)
640 @echo "...Linking Static Library for Simulator Target..."
641 $(SIM_AR) $(SIM_ARFLAGS) $(SIM_STATIC_LIB_TARGET) $(SIM_OBJS)
646 # Eclipse requires a clean command
648 -rm -rf $(NATIVE_OBJ_DIR)/*
653 @echo $(SDK_LOCATION)
675 @echo $(SOURCE_PATHS)
676 @echo "RESOURCE_OBJS"
677 @echo $(RESOURCE_OBJS)
678 @echo "RESOURCE_PATHS"
679 @echo $(RESOURCE_PATHS)
686 @echo "LINKER_OUTPUT"
687 @echo $(LINKER_OUTPUT)
688 @echo "SIM_LINKER_OUTPUT"
689 @echo $(SIM_LINKER_OUTPUT)
690 @echo "SIM_GCC_SLIBS"
691 @echo $(SIM_GCC_SLIBS)
692 @echo "SIM_GCC_SLIB_PATHS"
693 @echo $(SIM_GCC_SLIB_PATHS)
699 # dependency generation
700 # Generate dependencies with depend target "make depend"
706 # Adds $(SIM_OBJ_DIR) to target .o file
707 # ...Search for string starting at the beginning of the line [^]
708 # ...that contain anything followed by .o [.*\.o]
709 # ...and remember that string [\(...\)]
710 # ...replace that string with $(SIM_OBJ_DIR)/<tagged string> [$$(SIM_OBJ_DIR)/\1]
711 # ($ is doubled so that make doesn't interpret the variable syntax)
713 SOURCE_SEDSCRIPT = sed -e's%^\(.*\.o\)%$$(OBJ_DIR)/\1%'
714 SOURCE_SIM_SEDSCRIPT = sed -e's%^\(.*\.o\)%$$(SIM_OBJ_DIR)/\1%'
716 # Command adds $(RSC_OBJ_DIR) and converts .xrd to .trc
717 RESOURCE_TARGET_SEDSCRIPT = sed -e';s%^\(.*\).xrd%$$(RSC_OBJ_DIR)/\1.trc%'
719 # Command to escape spaces in a path
720 ESCAPE_SPACES_SEDSCRIPT = sed 's/ /\\\ /g'
722 # Take out all newlines (and/or returns) and replace with spaces
723 # ...putting all dependencies on the same line
724 RESOURCE_PREREQ_SEDSCRIPT = tr '\r\n' ' '
727 @echo "" > .dependencies
728 @$(SIM_CC) $(SIM_INCLUDES) $(SIM_CFLAGS) $(DEPFLAG) $(SOURCES) | $(SOURCE_SIM_SEDSCRIPT) >> .dependencies
729 @$(SIM_CC) $(SIM_INCLUDES) $(SIM_CFLAGS) $(DEPFLAG) $(SOURCES) | $(SOURCE_SEDSCRIPT) >> .dependencies
730 @for i in $(RESOURCES); do \
731 echo "$$i: \\" | $(RESOURCE_TARGET_SEDSCRIPT) >> .resdependencies; \
732 "$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) $(RFLAGS) -locale $(LOCALE) -makedeps $$i.tmp "`cygpath -w -a ./$$i`"; \
733 cygpath -m -f $$i.tmp | $(ESCAPE_SPACES_SEDSCRIPT) >> $$i.deps; \
735 cat $$i.deps | $(RESOURCE_PREREQ_SEDSCRIPT) >> .resdependencies; \
736 echo "" >> .resdependencies; \
738 cat .resdependencies >> .dependencies; \
739 rm -rf .resdependencies; \
746 -include .dependencies