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 ifeq ($(TARGET_FORMAT), )
164 TARGET_FORMAT=PalmOS6
167 # Compiler settings... compiler + optimizations + debug
168 # This is a makefile for Palm OS 6 so the compilers used are as follows:
169 # Device target compiler is pacc
170 # Simulator target compiler is gcc
172 CC = "$(TOOLS_DIR)pacc"
175 CFLAGS += -D__PALMOS_KERNEL__=1 -D__PALMOS__=0x06000000
176 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
178 # Warning level for device target
179 ifeq ($(WARNING_LEVEL), ALL)
182 ifeq ($(WARNING_LEVEL), SOME)
185 ifeq ($(WARNING_LEVEL), NONE)
191 # Warning level for simulator target
192 ifeq ($(SIM_WARNING_LEVEL), ALL)
195 ifeq ($(SIM_WARNING_LEVEL), NONE)
200 # Warnings as errors for device builds
201 ifeq ($(WARNING_AS_ERROR), TRUE)
205 # Warnings as errors for simulator builds
206 ifeq ($(SIM_WARNING_AS_ERROR), TRUE)
207 SIM_CFLAGS += -Werror
210 # Adding after other warnings flags so this is always in effect
211 SIM_CFLAGS += -Wno-multichar
213 # Verbose output for device build
214 ifeq ($(VERBOSE), TRUE)
218 # Verbose output for simulator build
219 ifeq ($(SIM_VERBOSE), TRUE)
224 ifeq ($(ARM_LOGO), TRUE)
230 # Exception handling support
231 ifeq ($(ENABLE_EXCEPTIONS), TRUE)
236 # Assertion handling support
237 ifeq ($(ENABLE_ASSERTIONS), TRUE)
243 # Additional linker flags
244 ifdef ADDITIONAL_PALINK_FLAGS
245 LDFLAGS += $(ADDITIONAL_PALINK_FLAGS)
248 # Optimization settings
249 ifeq ($(OPTIMIZE_LEVEL), INLINING)
251 SIM_OPTIMIZER_FLAG = -O3
253 ifeq ($(OPTIMIZE_LEVEL), INTERPROCEDURAL)
255 SIM_OPTIMIZER_FLAG = -O3
257 ifeq ($(OPTIMIZE_LEVEL), FULL)
259 SIM_OPTIMIZER_FLAG = -O3
261 ifeq ($(OPTIMIZE_LEVEL), INTRAPROCEDURAL)
263 SIM_OPTIMIZER_FLAG = -O3
265 ifeq ($(OPTIMIZE_LEVEL), SOME)
267 SIM_OPTIMIZER_FLAG = -O1
269 ifeq ($(OPTIMIZE_LEVEL), NONE)
271 SIM_OPTIMIZER_FLAG = -O0
273 # Default to 0 for debug, 3 for release
274 ifeq ($(DEBUG_OR_RELEASE), Debug)
276 SIM_OPTIMIZER_FLAG = -O0
279 SIM_OPTIMIZER_FLAG = -O3
288 # Debug settings (can override optimize settings)
289 ifeq ($(DEBUG_OR_RELEASE), Debug)
291 BUILD_TYPE_FLAG = -DBUILD_TYPE=BUILD_TYPE_DEBUG
292 TRACE_OUTPUT_FLAG = -DTRACE_OUTPUT=TRACE_OUTPUT_ON
294 BUILD_TYPE_FLAG = -DBUILD_TYPE=BUILD_TYPE_RELEASE
295 TRACE_OUTPUT_FLAG = -DTRACE_OUTPUT=TRACE_OUTPUT_OFF
298 ifeq ($(DEBUG_OR_RELEASE), Debug)
299 OBJ_DIR = $(DEBUG_DEVICE_OUTPUT_DIR)
300 SIM_OBJ_DIR = $(DEBUG_SIMULATOR_OUTPUT_DIR)
302 OBJ_DIR = $(RELEASE_DEVICE_OUTPUT_DIR)
303 SIM_OBJ_DIR = $(RELEASE_SIMULATOR_OUTPUT_DIR)
307 CFLAGS += $(OPTIMIZER_FLAG) $(DEBUG_FLAG) $(BUILD_TYPE_FLAG) $(TRACE_OUTPUT_FLAG)
308 SIM_CFLAGS += $(SIM_OPTIMIZER_FLAG) $(DEBUG_FLAG) $(BUILD_TYPE_FLAG) $(TRACE_OUTPUT_FLAG)
310 # Linker settings (must come after setting DEBUG_FLAG)
311 LD = "$(TOOLS_DIR)pacc"
314 LDFLAGS += $(DEBUG_FLAG) -nologo -Wl,-nolocals
315 SIM_LDFLAGS += $(DEBUG_FLAG) -mno-cygwin -mwindows $(SIM_OBJ_DIR)/gcc_link.def -shared -nostdlib -u___divdi3 -u___moddi3 -u___udivdi3 -u___umoddi3
316 SIM_LIBS = -L "$(TOOLS_DIR)misclibs" -lpxstlport -lpxsupc++ -lpxgcc -lgcc
317 ifeq ($(DEBUG_OR_RELEASE), Debug)
318 LDFLAGS += -Wl,-debug -Wl,-libpath -Wl,"$(SDK_LOCATION)libraries/ARM_4T/Debug/Default"
319 SIM_LIBS += "$(SDK_LOCATION)libraries/Simulator/Debug/PalmOS.lib"
321 LDFLAGS += -Wl,-libpath -Wl,"$(SDK_LOCATION)libraries/ARM_4T/Release/Default"
322 SIM_LIBS += "$(SDK_LOCATION)libraries/Simulator/Release/PalmOS.lib"
325 LDOBJS = PalmOS.a SystemGlue.a FloatMgr.sa
327 ifeq ($(TARGET_PLATFORM), Device)
328 NATIVE_OBJ_DIR := $(OBJ_DIR)
329 RSC_OBJ_DIR := $(OBJ_DIR)
331 NATIVE_OBJ_DIR := $(SIM_OBJ_DIR)
332 RSC_OBJ_DIR := $(SIM_OBJ_DIR)
336 AR="$(TOOLS_DIR)palib"
342 LINKER_OUTPUT := $(OBJ_DIR)/$(DATABASE_NAME).axf
343 SIM_LINKER_OUTPUT := $(SIM_OBJ_DIR)/$(DATABASE_NAME).dll
345 TARGET := $(OBJ_DIR)/$(PRC_NAME)
346 SIM_TARGET := $(SIM_OBJ_DIR)/$(PRC_NAME)
348 STATIC_LIB_TARGET := $(OBJ_DIR)/$(LIB_NAME)
349 SIM_STATIC_LIB_TARGET := $(SIM_OBJ_DIR)/$(SIM_LIB_NAME)
351 ###############################################################################
352 # Resource flags (PalmRC)
356 # Default text encoding is Latin
357 ifeq ($(PRC_TEXT_ENCODING), )
358 PRC_TEXT_ENCODING = LATIN
361 ifeq ($(PRC_TEXT_ENCODING), LATIN)
362 RFLAGS += -target 4.0
364 ifeq ($(PRC_TEXT_ENCODING), JAPANESE)
365 RFLAGS += -target 4.0J
367 ifeq ($(PRC_TEXT_ENCODING), SIMPLIFIED_CHINESE)
368 RFLAGS += -target 4.0CS
373 ifeq ($(PRC_NO_LOCALE_CHECK), TRUE)
374 RFLAGS += -noLocaleCheck
377 ifeq ($(PRC_STRICT_LOCALE), TRUE)
378 RFLAGS += -strictLocale
381 ifeq ($(PRC_STRICT_ENCODING), TRUE)
382 RFLAGS += -strictTextEncoding
385 ifdef PRC_OVERLAY_FILTER
386 RFLAGS += -overlayFilter $(PRC_OVERLAY_FILTER)
389 ifeq ($(PRC_NO_WARN_SIZE), TRUE)
390 RFLAGS += -noWarnSize
393 ifeq ($(PRC_QUIET), TRUE)
397 ifeq ($(PRCMERGE_QUIET), TRUE)
401 ###############################################################################
403 # function for converting sources to object file names in one of output directories
404 define SOURCE_LIST_TO_OBJS
405 $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
406 $(basename $(notdir $(file))))))
409 # function for converting sources to object file names in $(SIM_OBJ_DIR)
410 define SOURCE_LIST_TO_SIM_OBJS
411 $(addprefix $(SIM_OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
412 $(basename $(notdir $(file))))))
415 # function for converting resources into resource object files
416 define RESOURCE_LIST_TO_OBJS
417 $(addprefix $(RSC_OBJ_DIR)/, $(addsuffix .trc, $(foreach file, $(RESOURCES), \
418 $(basename $(file)))))
421 OBJS = $(SOURCE_LIST_TO_OBJS)
422 SIM_OBJS = $(SOURCE_LIST_TO_SIM_OBJS)
423 SOURCE_PATHS += $(sort $(foreach file, $(SOURCES), $(dir $(file))))
424 RESOURCE_OBJS = $(RESOURCE_LIST_TO_OBJS)
425 RESOURCE_PATHS += $(sort $(foreach file, $(RESOURCES), $(dir $(file))))
426 SLD_BASENAME := $(addsuffix _Startup, $(basename $(notdir $(SLD_FILE))))
427 SLD_OBJ := $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(SLD_BASENAME)))
428 SLD_SIM_OBJ := $(addprefix $(SIM_OBJ_DIR)/, $(addsuffix .o, $(SLD_BASENAME)))
431 VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SOURCE_PATHS) $(RESOURCE_PATHS) )))
433 # -I "$(SDK_LOCATION)include" -I "$(SDK_LOCATION)include/Core/System" #
434 SYSTEM_INCLUDES = $(SYSTEM_INCLUDE_PATHS) -I "$(SDK_LOCATION)headers" -I "$(SDK_LOCATION)headers/posix"
435 INCLUDES = $(LOCAL_INCLUDE_PATHS) $(foreach path, $(SOURCE_PATHS), $(addprefix -I, $(path))) $(SYSTEM_INCLUDES) $(PRE_INCLUDE_PATHS)
436 CPP_INCLUDES = -I "$(TOOLS_DIR)include/stlport"
438 SIM_SYSTEM_INCLUDES = $(SYSTEM_SIM_INCLUDE_PATHS) -I "$(SDK_LOCATION)headers" -I "$(SDK_LOCATION)headers/posix"
439 SIM_INCLUDES = $(LOCAL_SIM_INCLUDE_PATHS) $(foreach path, $(SOURCE_PATHS), $(addprefix -I, $(path))) $(SIM_SYSTEM_INCLUDES) $(SIM_PRE_INCLUDE_PATHS)
440 SIM_CPP_INCLUDES = -I "$(TOOLS_DIR)include/stlport"
442 # Now add additional settings specified by user
443 LDFLAGS += $(ADDITIONAL_LINK_LIBRARIES)
444 LDFLAGS += $(foreach libpath, $(ADDITIONAL_LINK_LIBPATH), $(addprefix -libpath , $(libpath)))
445 LDFLAGS += $(foreach option, $(ADDITIONAL_LINKER_FLAGS), $(addprefix -Wl$(comma), $(option)))
446 CFLAGS += $(foreach define, $(DEFINES), $(addprefix -D, $(define)))
447 CFLAGS += $(foreach define, $(UNDEFINES), $(addprefix -U, $(define)))
448 CFLAGS += $(ADDITIONAL_COMPILER_FLAGS)
450 SIM_LDFLAGS += $(ADDITIONAL_SIM_LINK_LIBRARIES)
451 SIM_LDFLAGS += $(ADDITIONAL_SIM_LINKER_FLAGS)
452 SIM_LDFLAGS += $(foreach libpath, $(ADDITIONAL_SIM_LINK_LIBPATH), $(addprefix -L, $(libpath)))
453 SIM_CFLAGS += $(foreach define, $(SIM_DEFINES), $(addprefix -D, $(define)))
454 SIM_CFLAGS += $(foreach define, $(SIM_UNDEFINES), $(addprefix -U, $(define)))
455 SIM_CFLAGS += $(ADDITIONAL_SIM_COMPILER_FLAGS)
457 # Specifyc additional archival flags (for static libraries)
458 ARFLAGS += $(ADDITIONAL_AR_FLAGS)
459 SIM_ARFLAGS += $(ADDITIONAL_SIM_AR_FLAGS)
461 RFLAGS += $(ADDITIONAL_PRC_FLAGS)
462 PRCFLAGS += $(ADDITIONAL_PRCMERGE_FLAGS)
464 ###############################################################################
465 # Flags for PRC creation
467 PRCFLAGS += -dbFlagExtendedDB -dbFlagExecutable
469 PRCFLAGS += -dbVersion $(DATABASE_VERSION) $(DATABASE_PROTECT) $(DATABASE_HIDDEN) $(DATABASE_BACKUP) $(DATABASE_RESET) $(DATABASE_BUNDLE)
472 ###############################################################################
476 PSLIB_SIM_FLAGS = -outSimgcc
477 ifeq ($(PROJECT_TYPE), slib)
478 PSLIB_DEV_FLAGS += -outEntryNums $(OBJ_DIR)/$(DATABASE_NAME)_Client.h -outObjStubs $(OBJ_DIR)/$(DATABASE_NAME)_Client.sa
479 PSLIB_SIM_FLAGS += -outEntryNums $(SIM_OBJ_DIR)/$(DATABASE_NAME)_Client.h -outSimStubs $(SIM_OBJ_DIR)/$(DATABASE_NAME)_Client.slib
484 ###############################################################################
485 # Project make target determination
487 ifeq ($(TARGET_PLATFORM), Device)
489 ifeq ($(PROJECT_TYPE), )
490 PROJECT_TARGET = device
493 ifeq ($(PROJECT_TYPE), appl)
494 PROJECT_TARGET = device
496 ifeq ($(PROJECT_TYPE), slib)
497 PROJECT_TARGET = device_shared_lib
499 ifeq ($(PROJECT_TYPE), lib)
500 PROJECT_TARGET = device_static_lib
505 ifeq ($(PROJECT_TYPE), )
506 PROJECT_TARGET = simulator
509 ifeq ($(PROJECT_TYPE), appl)
510 PROJECT_TARGET = simulator
512 ifeq ($(PROJECT_TYPE), slib)
513 PROJECT_TARGET = simulator_shared_lib
515 ifeq ($(PROJECT_TYPE), lib)
516 PROJECT_TARGET = simulator_static_lib
521 ###############################################################################
522 # Eclipse requires an all target to get the work done
524 all: $(PROJECT_TARGET)
526 # This rule is only valid for projects created as application projects.
527 # Don't invoke this make target directly; instead change the value of
528 # TARGET_PLATFORM to Device in the main makefile
529 device: $(OBJ_DIR) $(TARGET)
531 # This rule is only valid for projects created as application projects.
532 # Don't invoke this make target directly; instead change the value of
533 # TARGET_PLATFORM to Simulator in the main makefile
534 simulator: $(SIM_OBJ_DIR) $(SIM_TARGET)
536 # This rule is only valid for projects created as shared library projects.
537 # Don't invoke this make target directly; instead change the value of
538 # TARGET_PLATFORM to Device in the main makefile
539 device_shared_lib: $(OBJ_DIR) $(TARGET)
541 # This rule is only valid for projects created as shared library projects.
542 # Don't invoke this make target directly; instead change the value of
543 # TARGET_PLATFORM to Simulator in the main makefile
544 simulator_shared_lib: $(SIM_OBJ_DIR) $(SIM_TARGET)
546 # This rule is only valid for projects created as static library projects.
547 # Don't invoke this make target directly; instead change the value of
548 # TARGET_PLATFORM to Device in the main makefile
549 device_static_lib: $(OBJ_DIR) $(STATIC_LIB_TARGET)
551 # This rule is only valid for projects created as static library projects.
552 # Don't invoke this make target directly; instead change the value of
553 # TARGET_PLATFORM to Simulator in the main makefile
554 simulator_static_lib: $(SIM_OBJ_DIR) $(SIM_STATIC_LIB_TARGET)
557 # rule to create the object file directories if needed
559 @[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
562 @[ -d $(SIM_OBJ_DIR) ] || mkdir $(SIM_OBJ_DIR) > /dev/null 2>&1
565 $(OBJ_DIR)/%.o : %.c makefile
566 $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@
567 $(OBJ_DIR)/%.o : %.cpp makefile
568 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
569 $(OBJ_DIR)/%.o : %.cp makefile
570 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
571 $(OBJ_DIR)/%.o : %.cc makefile
572 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
573 $(OBJ_DIR)/%.o : %.C makefile
574 $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@
575 $(OBJ_DIR)/%.o : %.CC makefile
576 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
577 $(OBJ_DIR)/%.o : %.CPP makefile
578 $(CC) -c $< $(INCLUDES) $(CPP_INCLUDES) $(CFLAGS) -o $@
580 # Simulator C/C++ sources
581 $(SIM_OBJ_DIR)/%.o : %.c makefile
582 $(SIM_CC) -c $< $(SIM_INCLUDES) -std=c99 $(SIM_CFLAGS) -o $@
583 $(SIM_OBJ_DIR)/%.o : %.cpp makefile
584 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
585 $(SIM_OBJ_DIR)/%.o : %.cp makefile
586 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
587 $(SIM_OBJ_DIR)/%.o : %.cc makefile
588 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
589 $(SIM_OBJ_DIR)/%.o : %.C makefile
590 $(SIM_CC) -c $< $(SIM_INCLUDES) -std=c99 $(SIM_CFLAGS) -o $@
591 $(SIM_OBJ_DIR)/%.o : %.CC makefile
592 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
593 $(SIM_OBJ_DIR)/%.o : %.CPP makefile
594 $(SIM_CC) -c $< $(SIM_INCLUDES) $(SIM_CPP_INCLUDES) -frtti $(SIM_CFLAGS) -o $@
597 # XRD source processing
598 $(RSC_OBJ_DIR)/%.trc : %.xrd makefile
599 "$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) -makeDeps $(@D)/$(*F).deps $(RFLAGS) -locale $(LOCALE) "`cygpath -w -a ./$<`" -o $@
600 $(RSC_OBJ_DIR)/%.trc : %.XRD makefile
601 "$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) -makeDeps $(@D)/$(*F).deps $(RFLAGS) -locale $(LOCALE) "`cygpath -w -a ./$<`" -o $@
604 # Definition file source processing
605 $(SLD_OBJ) : makefile
606 @echo "...Processing definition file for Device..."
607 "$(TOOLS_DIR)pslib" -inDef "$(SLD_FILE)" $(PSLIB_DEV_FLAGS) -outObjStartup $@ -type '$(DB_TYPE)' -creator '$(CREATOR_ID)' -execName $(DATABASE_NAME)
608 $(INSTALL_DIR) $(incdir)/wx/
609 $(INSTALL_DATA) ../../include/wx/palmos/setup0.h $(incdir)/wx/setup.h
612 $(SLD_SIM_OBJ) : makefile
613 @echo "...Processing definition file for Simulator..."
614 "$(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)
615 $(INSTALL_DIR) $(incdir)/wx/
616 $(INSTALL_DATA) ../../include/wx/palmos/setup0.h $(incdir)/wx/setup.h
619 $(LINKER_OUTPUT) : $(OBJS)
620 @echo "...Linking for Device Target..."
621 $(LD) -o $(LINKER_OUTPUT) $(OBJS) $(SLD_OBJ) $(LDOBJS) $(LDFLAGS)
623 $(SIM_LINKER_OUTPUT) : $(SIM_OBJS)
624 @echo "...Linking for Simulator Target..."
625 $(SIM_LD) --entry 0 -o $(SIM_LINKER_OUTPUT) $(SIM_OBJS) $(SLD_SIM_OBJ) $(SIM_LDFLAGS) $(SIM_LIBS)
628 # Final target creation
629 $(TARGET): $(SLD_OBJ) $(LINKER_OUTPUT) $(RESOURCE_OBJS)
630 @echo "...Creating PRC for Device: $(TARGET)"
631 "$(TOOLS_DIR)pelf2bin" -format 6 -directory $(OBJ_DIR) -code acod -data adat -rsrc 0x0000 $(LINKER_OUTPUT)
632 "$(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
633 @echo ...Done with Device build...
636 $(SIM_TARGET): $(SLD_SIM_OBJ) $(SIM_LINKER_OUTPUT) $(RESOURCE_OBJS)
637 @echo "...Creating PRC for Simulator: $(SIM_TARGET)"
638 cp -f "$(SDK_LOCATION)misctools/Resources/amdd_fake" $(SIM_OBJ_DIR)/adat0000.bin
639 "$(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
640 @echo ...Done with Simulator build...
643 $(STATIC_LIB_TARGET) : $(OBJS)
644 @echo "...Linking Static Library for Device Target..."
645 $(AR) $(ARFLAGS) $(STATIC_LIB_TARGET) $(OBJS)
647 $(SIM_STATIC_LIB_TARGET) : $(SIM_OBJS)
648 @echo "...Linking Static Library for Simulator Target..."
649 $(SIM_AR) $(SIM_ARFLAGS) $(SIM_STATIC_LIB_TARGET) $(SIM_OBJS)
654 # Eclipse requires a clean command
656 -rm -rf $(NATIVE_OBJ_DIR)/*
661 @echo $(SDK_LOCATION)
683 @echo $(SOURCE_PATHS)
684 @echo "RESOURCE_OBJS"
685 @echo $(RESOURCE_OBJS)
686 @echo "RESOURCE_PATHS"
687 @echo $(RESOURCE_PATHS)
694 @echo "LINKER_OUTPUT"
695 @echo $(LINKER_OUTPUT)
696 @echo "SIM_LINKER_OUTPUT"
697 @echo $(SIM_LINKER_OUTPUT)
698 @echo "SIM_GCC_SLIBS"
699 @echo $(SIM_GCC_SLIBS)
700 @echo "SIM_GCC_SLIB_PATHS"
701 @echo $(SIM_GCC_SLIB_PATHS)
707 # dependency generation
708 # Generate dependencies with depend target "make depend"
714 # Adds $(SIM_OBJ_DIR) to target .o file
715 # ...Search for string starting at the beginning of the line [^]
716 # ...that contain anything followed by .o [.*\.o]
717 # ...and remember that string [\(...\)]
718 # ...replace that string with $(SIM_OBJ_DIR)/<tagged string> [$$(SIM_OBJ_DIR)/\1]
719 # ($ is doubled so that make doesn't interpret the variable syntax)
721 SOURCE_SEDSCRIPT = sed -e's%^\(.*\.o\)%$$(OBJ_DIR)/\1%'
722 SOURCE_SIM_SEDSCRIPT = sed -e's%^\(.*\.o\)%$$(SIM_OBJ_DIR)/\1%'
724 # Command adds $(RSC_OBJ_DIR) and converts .xrd to .trc
725 RESOURCE_TARGET_SEDSCRIPT = sed -e';s%^\(.*\).xrd%$$(RSC_OBJ_DIR)/\1.trc%'
727 # Command to escape spaces in a path
728 ESCAPE_SPACES_SEDSCRIPT = sed 's/ /\\\ /g'
730 # Take out all newlines (and/or returns) and replace with spaces
731 # ...putting all dependencies on the same line
732 RESOURCE_PREREQ_SEDSCRIPT = tr '\r\n' ' '
735 @echo "" > .dependencies
736 @$(SIM_CC) $(SIM_INCLUDES) $(SIM_CFLAGS) $(DEPFLAG) $(SOURCES) | $(SOURCE_SIM_SEDSCRIPT) >> .dependencies
737 @$(SIM_CC) $(SIM_INCLUDES) $(SIM_CFLAGS) $(DEPFLAG) $(SOURCES) | $(SOURCE_SEDSCRIPT) >> .dependencies
738 @for i in $(RESOURCES); do \
739 echo "$$i: \\" | $(RESOURCE_TARGET_SEDSCRIPT) >> .resdependencies; \
740 "$(TOOLS_DIR)PalmRC" -p $(TARGET_FORMAT) $(RFLAGS) -locale $(LOCALE) -makedeps $$i.tmp "`cygpath -w -a ./$$i`"; \
741 cygpath -m -f $$i.tmp | $(ESCAPE_SPACES_SEDSCRIPT) >> $$i.deps; \
743 cat $$i.deps | $(RESOURCE_PREREQ_SEDSCRIPT) >> .resdependencies; \
744 echo "" >> .resdependencies; \
746 cat .resdependencies >> .dependencies; \
747 rm -rf .resdependencies; \
754 -include .dependencies