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 ###############################################################################
68 FN_DEPEND=.dependencies
76 # Locale (defaults to English)
81 ifeq ($(CREATOR_ID), )
93 ifeq ($(DEBUG_DEVICE_OUTPUT_DIR), )
94 DEBUG_DEVICE_OUTPUT_DIR = DebugDevice
97 ifeq ($(RELEASE_DEVICE_OUTPUT_DIR), )
98 RELEASE_DEVICE_OUTPUT_DIR = ReleaseDevice
101 ifeq ($(DEBUG_SIMULATOR_OUTPUT_DIR), )
102 DEBUG_SIMULATOR_OUTPUT_DIR = DebugSim
105 ifeq ($(RELEASE_SIMULATOR_OUTPUT_DIR), )
106 RELEASE_SIMULATOR_OUTPUT_DIR = ReleaseSim
109 ifeq ($(SDK_VERSION), )
113 ifeq ($(ENABLE_EXCEPTIONS), )
114 ENABLE_EXCEPTIONS=TRUE
117 ###############################################################################
118 # App/PRC/Database Names
120 # The difference between App Name and Database name is that App Name may
121 # contain spaces while the database name is the App name with spaces removed.
122 # (Coded in such a way that if the user already explicitly defined these
123 # variables previously, we'll go with those).
125 ifeq ($(DATABASE_NAME), )
126 ifeq ($(ESCAPED_ARTIFACT_NAME), )
127 # Database name defaults if ARTIFACT_NAME is empty
128 DATABASE_NAME = StartApp
130 DATABASE_NAME = $(ESCAPED_ARTIFACT_NAME)
135 ifeq ($(ESCAPED_ARTIFACT_NAME), )
136 # PRC name defaults if ESCAPED_ARTIFACT_NAME is empty
139 PRC_NAME = $(DATABASE_NAME).prc
144 ifeq ($(ESCAPED_ARTIFACT_NAME), )
145 # LIB name defaults if ESCAPED_ARTIFACT_NAME is empty
148 LIB_NAME = $(DATABASE_NAME).a
152 ifeq ($(SIM_LIB_NAME), )
153 ifeq ($(ESCAPED_ARTIFACT_NAME), )
154 # SIM LIB name defaults if ESCAPED_ARTIFACT_NAME is empty
155 SIM_LIB_NAME = Start.lib
157 SIM_LIB_NAME = $(DATABASE_NAME).lib
161 ###############################################################################
162 # Compile and Link Settings
164 ifeq ($(TARGET_FORMAT), )
165 TARGET_FORMAT=PalmOS6
168 # Compiler settings... compiler + optimizations + debug
169 # This is a makefile for Palm OS 6 so the compilers used are as follows:
170 # Device target compiler is pacc
171 # Simulator target compiler is gcc
173 UNAME :=$(shell uname)
174 ifeq ($(UNAME),Linux)
176 PELF2BIN:=wine "$(TOOLS_DIR)/pelf2bin.exe"
177 PSLIB:=wine "$(TOOLS_DIR)/pslib.exe"
178 PRCMERGE :=wine "$(TOOLS_DIR)/PRCMerge.exe"
179 PALMRC :=wine "$(TOOLS_DIR)/PalmRc.exe"
182 CC = wine "$(TOOLS_DIR)pacc"
183 CXX = wine "$(TOOLS_DIR)pacc"
184 LD = wine "$(TOOLS_DIR)pacc"
187 PELF2BIN:="$(TOOLS_DIR)/pelf2bin"
188 PSLIB:="$(TOOLS_DIR)/pslib.exe"
189 PRCMERGE :="$(TOOLS_DIR)/PRCMerge.exe"
190 PALMRC :="$(TOOLS_DIR)/PalmRc.exe"
191 CYGPATH_WA:=cygpath -w -a
192 CYGPATH_MF:=cygpath -m -f
193 CC = "$(TOOLS_DIR)pacc"
194 CXX = "$(TOOLS_DIR)pacc"
195 LD = "$(TOOLS_DIR)pacc"
201 DEV_CFLAGS += -D__PALMOS_KERNEL__=1 -D__PALMOS__=0x06000000
202 SIM_CFLAGS += -fexceptions -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 #-mno-cygwin -mwindows
204 # Warning level for device target
205 ifeq ($(WARNING_LEVEL), ALL)
208 ifeq ($(WARNING_LEVEL), SOME)
211 ifeq ($(WARNING_LEVEL), NONE)
217 # Warning level for simulator target
218 ifeq ($(SIM_WARNING_LEVEL), ALL)
221 ifeq ($(SIM_WARNING_LEVEL), NONE)
226 # Warnings as errors for device builds
227 ifeq ($(WARNING_AS_ERROR), TRUE)
228 DEV_CFLAGS += -Werror
231 # Warnings as errors for simulator builds
232 ifeq ($(SIM_WARNING_AS_ERROR), TRUE)
233 SIM_CFLAGS += -Werror
236 # Adding after other warnings flags so this is always in effect
237 SIM_CFLAGS += -Wno-multichar
239 # Verbose output for device build
240 ifeq ($(VERBOSE), TRUE)
244 # Verbose output for simulator build
245 ifeq ($(SIM_VERBOSE), TRUE)
250 ifeq ($(ARM_LOGO), TRUE)
253 DEV_CFLAGS += -nologo
256 # Exception handling support
257 ifeq ($(ENABLE_EXCEPTIONS), TRUE)
262 # Assertion handling support
263 ifeq ($(ENABLE_ASSERTIONS), TRUE)
264 DEV_CFLAGS += -UNDEBUG
266 DEV_CFLAGS += -DNDEBUG=1
269 # Additional linker flags
270 ifdef ADDITIONAL_PALINK_FLAGS
271 DEV_LDFLAGS += $(ADDITIONAL_PALINK_FLAGS)
274 # Optimization settings
275 ifeq ($(OPTIMIZE_LEVEL), INLINING)
277 SIM_OPTIMIZER_FLAG = -O3
279 ifeq ($(OPTIMIZE_LEVEL), INTERPROCEDURAL)
281 SIM_OPTIMIZER_FLAG = -O3
283 ifeq ($(OPTIMIZE_LEVEL), FULL)
285 SIM_OPTIMIZER_FLAG = -O3
287 ifeq ($(OPTIMIZE_LEVEL), INTRAPROCEDURAL)
289 SIM_OPTIMIZER_FLAG = -O3
291 ifeq ($(OPTIMIZE_LEVEL), SOME)
293 SIM_OPTIMIZER_FLAG = -O1
295 ifeq ($(OPTIMIZE_LEVEL), NONE)
297 SIM_OPTIMIZER_FLAG = -O0
299 # Default to 0 for debug, 3 for release
300 ifeq ($(DEBUG_OR_RELEASE), Debug)
302 SIM_OPTIMIZER_FLAG = -O0
305 SIM_OPTIMIZER_FLAG = -O3
314 # Debug settings (can override optimize settings)
315 ifeq ($(DEBUG_OR_RELEASE), Debug)
317 BUILD_TYPE_FLAG = -DBUILD_TYPE=BUILD_TYPE_DEBUG
318 TRACE_OUTPUT_FLAG = -DTRACE_OUTPUT=TRACE_OUTPUT_ON
320 BUILD_TYPE_FLAG = -DBUILD_TYPE=BUILD_TYPE_RELEASE
321 TRACE_OUTPUT_FLAG = -DTRACE_OUTPUT=TRACE_OUTPUT_OFF
324 ifeq ($(DEBUG_OR_RELEASE), Debug)
325 OBJ_DIR = $(DEBUG_DEVICE_OUTPUT_DIR)
326 SIM_OBJ_DIR = $(DEBUG_SIMULATOR_OUTPUT_DIR)
328 OBJ_DIR = $(RELEASE_DEVICE_OUTPUT_DIR)
329 SIM_OBJ_DIR = $(RELEASE_SIMULATOR_OUTPUT_DIR)
333 DEV_CFLAGS += $(OPTIMIZER_FLAG) $(DEBUG_FLAG) $(BUILD_TYPE_FLAG) $(TRACE_OUTPUT_FLAG)
334 SIM_CFLAGS += $(SIM_OPTIMIZER_FLAG) $(DEBUG_FLAG) $(BUILD_TYPE_FLAG) $(TRACE_OUTPUT_FLAG)
336 # Linker settings (must come after setting DEBUG_FLAG)
338 DEV_LDFLAGS += $(DEBUG_FLAG) -nologo -Wl,-nolocals
339 SIM_LDFLAGS += $(DEBUG_FLAG) -mno-cygwin -mwindows $(SIM_OBJ_DIR)/gcc_link.def -shared -nostdlib -u___divdi3 -u___moddi3 -u___udivdi3 -u___umoddi3
340 SIM_LIBS = -L "$(TOOLS_DIR)misclibs" -lpxstlport -lpxsupc++ -lpxgcc -lgcc
341 ifeq ($(DEBUG_OR_RELEASE), Debug)
342 DEV_LDFLAGS += -Wl,-debug -Wl,-libpath -Wl,"$(SDK_LOCATION)libraries/ARM_4T/Debug/Default"
343 SIM_LIBS += "$(SDK_LOCATION)libraries/Simulator/Debug/PalmOS.lib"
345 DEV_LDFLAGS += -Wl,-libpath -Wl,"$(SDK_LOCATION)libraries/ARM_4T/Release/Default"
346 SIM_LIBS += "$(SDK_LOCATION)libraries/Simulator/Release/PalmOS.lib"
349 LDOBJS = PalmOS.a SystemGlue.a FloatMgr.sa
351 ifeq ($(TARGET_PLATFORM), Device)
352 NATIVE_OBJ_DIR := $(OBJ_DIR)
353 RSC_OBJ_DIR := $(OBJ_DIR)
355 NATIVE_OBJ_DIR := $(SIM_OBJ_DIR)
356 RSC_OBJ_DIR := $(SIM_OBJ_DIR)
360 AR="$(TOOLS_DIR)palib"
366 LINKER_OUTPUT := $(OBJ_DIR)/$(DATABASE_NAME).axf
367 SIM_LINKER_OUTPUT := $(SIM_OBJ_DIR)/$(DATABASE_NAME).dll
369 TARGET := $(OBJ_DIR)/$(PRC_NAME)
370 SIM_TARGET := $(SIM_OBJ_DIR)/$(PRC_NAME)
372 STATIC_LIB_TARGET := $(OBJ_DIR)/$(LIB_NAME)
373 SIM_STATIC_LIB_TARGET := $(SIM_OBJ_DIR)/$(SIM_LIB_NAME)
375 ###############################################################################
376 # Resource flags (PalmRC)
380 # Default text encoding is Latin
381 ifeq ($(PRC_TEXT_ENCODING), )
382 PRC_TEXT_ENCODING = LATIN
385 ifeq ($(PRC_TEXT_ENCODING), LATIN)
386 RFLAGS += -target 4.0
388 ifeq ($(PRC_TEXT_ENCODING), JAPANESE)
389 RFLAGS += -target 4.0J
391 ifeq ($(PRC_TEXT_ENCODING), SIMPLIFIED_CHINESE)
392 RFLAGS += -target 4.0CS
397 ifeq ($(PRC_NO_LOCALE_CHECK), TRUE)
398 RFLAGS += -noLocaleCheck
401 ifeq ($(PRC_STRICT_LOCALE), TRUE)
402 RFLAGS += -strictLocale
405 ifeq ($(PRC_STRICT_ENCODING), TRUE)
406 RFLAGS += -strictTextEncoding
409 ifdef PRC_OVERLAY_FILTER
410 RFLAGS += -overlayFilter $(PRC_OVERLAY_FILTER)
413 ifeq ($(PRC_NO_WARN_SIZE), TRUE)
414 RFLAGS += -noWarnSize
417 ifeq ($(PRC_QUIET), TRUE)
421 ifeq ($(PRCMERGE_QUIET), TRUE)
425 ###############################################################################
427 # function for converting sources to object file names in one of output directories
428 define SOURCE_LIST_TO_OBJS
429 $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
430 $(basename $(notdir $(file))))))
433 # function for converting sources to object file names in $(SIM_OBJ_DIR)
434 define SOURCE_LIST_TO_SIM_OBJS
435 $(addprefix $(SIM_OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SOURCES), \
436 $(basename $(notdir $(file))))))
439 # function for converting resources into resource object files
440 define RESOURCE_LIST_TO_OBJS
441 $(addprefix $(RSC_OBJ_DIR)/, $(addsuffix .trc, $(foreach file, $(RESOURCES), \
442 $(basename $(file)))))
444 DEV_OBJS = $(SOURCE_LIST_TO_OBJS)
445 SIM_OBJS = $(SOURCE_LIST_TO_SIM_OBJS)
446 SOURCE_PATHS += $(sort $(foreach file, $(SOURCES), $(dir $(file))))
447 RESOURCE_OBJS = $(RESOURCE_LIST_TO_OBJS)
448 RESOURCE_PATHS += $(sort $(foreach file, $(RESOURCES), $(dir $(file))))
449 SLD_BASENAME := $(addsuffix _Startup, $(basename $(notdir $(SLD_FILE))))
450 SLD_OBJ := $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(SLD_BASENAME)))
451 SLD_SIM_OBJ := $(addprefix $(SIM_OBJ_DIR)/, $(addsuffix .o, $(SLD_BASENAME)))
454 VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SOURCE_PATHS) $(RESOURCE_PATHS) )))
456 # -I "$(SDK_LOCATION)include" -I "$(SDK_LOCATION)include/Core/System" #
457 SYSTEM_INCLUDES = $(SYSTEM_INCLUDE_PATHS) -I "$(SDK_LOCATION)headers" -I "$(SDK_LOCATION)headers/posix"
458 INCLUDES = $(LOCAL_INCLUDE_PATHS) $(foreach path, $(SOURCE_PATHS), $(addprefix -I, $(path))) $(SYSTEM_INCLUDES) $(PRE_INCLUDE_PATHS)
459 DEV_CPP_INCLUDES = -I "$(TOOLS_DIR)include/stlport"
461 SIM_SYSTEM_INCLUDES = $(SYSTEM_SIM_INCLUDE_PATHS) -I "$(SDK_LOCATION)headers" -I "$(SDK_LOCATION)headers/posix"
462 SIM_INCLUDES = $(LOCAL_SIM_INCLUDE_PATHS) $(foreach path, $(SOURCE_PATHS), $(addprefix -I, $(path))) $(SIM_SYSTEM_INCLUDES) $(SIM_PRE_INCLUDE_PATHS)
463 SIM_CPP_INCLUDES = -I "$(TOOLS_DIR)include/stlport"
465 # Now add additional settings specified by user
466 DEV_LDFLAGS += $(ADDITIONAL_LINK_LIBRARIES)
467 DEV_LDFLAGS += $(foreach libpath, $(ADDITIONAL_LINK_LIBPATH), $(addprefix -libpath , $(libpath)))
468 DEV_LDFLAGS += $(foreach option, $(ADDITIONAL_LINKER_FLAGS), $(addprefix -Wl$(comma), $(option)))
469 DEV_CFLAGS += $(foreach define, $(DEFINES), $(addprefix -D, $(define)))
470 DEV_CFLAGS += $(foreach define, $(UNDEFINES), $(addprefix -U, $(define)))
471 DEV_CFLAGS += $(ADDITIONAL_COMPILER_FLAGS)
472 DEV_CFLAGS += $(INCLUDES)
474 SIM_LDFLAGS += $(ADDITIONAL_SIM_LINK_LIBRARIES)
475 SIM_LDFLAGS += $(ADDITIONAL_SIM_LINKER_FLAGS)
476 SIM_LDFLAGS += $(foreach libpath, $(ADDITIONAL_SIM_LINK_LIBPATH), $(addprefix -L, $(libpath)))
477 SIM_CFLAGS += $(foreach define, $(SIM_DEFINES), $(addprefix -D, $(define)))
478 SIM_CFLAGS += $(foreach define, $(SIM_UNDEFINES), $(addprefix -U, $(define)))
479 SIM_CFLAGS += $(ADDITIONAL_SIM_COMPILER_FLAGS)
480 SIM_CFLAGS += $(SIM_INCLUDES)
482 # Specifyc additional archival flags (for static libraries)
483 ARFLAGS += $(ADDITIONAL_AR_FLAGS)
484 SIM_ARFLAGS += $(ADDITIONAL_SIM_AR_FLAGS)
486 RFLAGS += $(ADDITIONAL_PRC_FLAGS)
487 PRCFLAGS += $(ADDITIONAL_PRCMERGE_FLAGS)
489 DEV_CXXFLAGS = $(DEV_CPP_INCLUDES) $(DEV_CFLAGS)
490 SIM_CXXFLAGS = $(SIM_CPP_INCLUDES) $(SIM_CFLAGS)
492 ifeq ($(TARGET_PLATFORM), Device)
495 CXXFLAGS=$(DEV_CXXFLAGS)
496 LDFLAGS=$(DEV_LDFLAGS)
500 CXXFLAGS=$(SIM_CXXFLAGS)
501 LDFLAGS=$(SIM_LDFLAGS)
504 ###############################################################################
505 # Flags for PRC creation
507 PRCFLAGS += -dbFlagExtendedDB -dbFlagExecutable
509 PRCFLAGS += -dbVersion $(DATABASE_VERSION) $(DATABASE_PROTECT) $(DATABASE_HIDDEN) $(DATABASE_BACKUP) $(DATABASE_RESET) $(DATABASE_BUNDLE)
512 ###############################################################################
516 PSLIB_SIM_FLAGS = -outSimgcc
517 ifeq ($(PROJECT_TYPE), slib)
518 PSLIB_DEV_FLAGS += -outEntryNums $(OBJ_DIR)/$(DATABASE_NAME)_Client.h -outObjStubs $(OBJ_DIR)/$(DATABASE_NAME)_Client.sa
519 PSLIB_SIM_FLAGS += -outEntryNums $(SIM_OBJ_DIR)/$(DATABASE_NAME)_Client.h -outSimStubs $(SIM_OBJ_DIR)/$(DATABASE_NAME)_Client.slib
522 ###############################################################################
523 # Project make target determination
525 ifeq ($(TARGET_PLATFORM), Device)
527 ifeq ($(PROJECT_TYPE), )
528 PROJECT_TARGET = device
531 ifeq ($(PROJECT_TYPE), appl)
532 PROJECT_TARGET = device
534 ifeq ($(PROJECT_TYPE), slib)
535 PROJECT_TARGET = device_shared_lib
537 ifeq ($(PROJECT_TYPE), lib)
538 PROJECT_TARGET = device_static_lib
543 ifeq ($(PROJECT_TYPE), )
544 PROJECT_TARGET = simulator
547 ifeq ($(PROJECT_TYPE), appl)
548 PROJECT_TARGET = simulator
550 ifeq ($(PROJECT_TYPE), slib)
551 PROJECT_TARGET = simulator_shared_lib
553 ifeq ($(PROJECT_TYPE), lib)
554 PROJECT_TARGET = simulator_static_lib
559 ###############################################################################
560 # Eclipse requires an all target to get the work done
562 all: $(FN_DEPEND).1 $(PROJECT_TARGET)
564 # This rule is only valid for projects created as application projects.
565 # Don't invoke this make target directly; instead change the value of
566 # TARGET_PLATFORM to Device in the main makefile
567 device: $(OBJ_DIR) $(TARGET)
569 # This rule is only valid for projects created as application projects.
570 # Don't invoke this make target directly; instead change the value of
571 # TARGET_PLATFORM to Simulator in the main makefile
572 simulator: $(SIM_OBJ_DIR) $(SIM_TARGET)
574 # This rule is only valid for projects created as shared library projects.
575 # Don't invoke this make target directly; instead change the value of
576 # TARGET_PLATFORM to Device in the main makefile
577 device_shared_lib: $(OBJ_DIR) $(TARGET)
579 # This rule is only valid for projects created as shared library projects.
580 # Don't invoke this make target directly; instead change the value of
581 # TARGET_PLATFORM to Simulator in the main makefile
582 simulator_shared_lib: $(SIM_OBJ_DIR) $(SIM_TARGET)
584 # This rule is only valid for projects created as static library projects.
585 # Don't invoke this make target directly; instead change the value of
586 # TARGET_PLATFORM to Device in the main makefile
587 device_static_lib: $(OBJ_DIR) $(STATIC_LIB_TARGET)
589 # This rule is only valid for projects created as static library projects.
590 # Don't invoke this make target directly; instead change the value of
591 # TARGET_PLATFORM to Simulator in the main makefile
592 simulator_static_lib: $(SIM_OBJ_DIR) $(SIM_STATIC_LIB_TARGET)
595 # rule to create the object file directories if needed
597 @[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
600 @[ -d $(SIM_OBJ_DIR) ] || mkdir $(SIM_OBJ_DIR) > /dev/null 2>&1
602 # Simulator C/C++ sources
603 $(SIM_OBJ_DIR)/%.o : %.c #makefile
604 $(SIM_CC) -c $< -std=c99 $(SIM_CFLAGS) -o $@
605 $(SIM_OBJ_DIR)/%.o : %.cpp #makefile
606 $(SIM_CC) -c $< -frtti $(SIM_CXXFLAGS) -o $@
607 $(SIM_OBJ_DIR)/%.o : %.cp #makefile
608 $(SIM_CC) -c $< -frtti $(SIM_CXXFLAGS) -o $@
609 $(SIM_OBJ_DIR)/%.o : %.cc #makefile
610 $(SIM_CC) -c $< -frtti $(SIM_CXXFLAGS) -o $@
611 $(SIM_OBJ_DIR)/%.o : %.C #makefile
612 $(SIM_CC) -c $< -std=c99 $(SIM_CFLAGS) -o $@
613 $(SIM_OBJ_DIR)/%.o : %.CC #makefile
614 $(SIM_CC) -c $< -frtti $(SIM_CXXFLAGS) -o $@
615 $(SIM_OBJ_DIR)/%.o : %.CPP #makefile
616 $(SIM_CC) -c $< -frtti $(SIM_CXXFLAGS) -o $@
619 # XRD source processing
620 $(RSC_OBJ_DIR)/%.trc : %.xrd makefile
621 $(PALMRC) -p $(TARGET_FORMAT) -makeDeps $(@D)/$(*F).deps $(RFLAGS) -locale $(LOCALE) "`$(CYGPATH_WA) ./$<`" -o $@
622 $(RSC_OBJ_DIR)/%.trc : %.XRD makefile
623 $(PALMRC) -p $(TARGET_FORMAT) -makeDeps $(@D)/$(*F).deps $(RFLAGS) -locale $(LOCALE) "`$(CYGPATH_WA) ./$<`" -o $@
626 # Definition file source processing
627 $(SLD_OBJ) : makefile
628 @echo "...Processing definition file for Device..."
629 $(PSLIB) -inDef "$(SLD_FILE)" $(PSLIB_DEV_FLAGS) -outObjStartup $@ -type '$(DB_TYPE)' -creator '$(CREATOR_ID)' -execName $(DATABASE_NAME)
630 # $(INSTALL_DIR) $(INCDIR_WXPALM)/wx/
631 # $(INSTALL_DATA) $(TOPDIR)/include/wx/palmos/setup0.h $(INCDIR_WXPALM)/wx/setup.h
634 $(SLD_SIM_OBJ) : makefile
635 @echo "...Processing definition file for Simulator..."
636 $(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)
637 # $(INSTALL_DIR) $(INCDIR_WXPALM)/wx/
638 # $(INSTALL_DATA) $(TOPDIR)/include/wx/palmos/setup0.h $(INCDIR_WXPALM)/wx/setup.h
642 $(LINKER_OUTPUT) : $(OBJS)
643 @echo "...Linking for Device Target..."
644 $(LD) -o $(LINKER_OUTPUT) $(OBJS) $(SLD_OBJ) $(LDOBJS) $(LDFLAGS)
646 $(SIM_LINKER_OUTPUT) : $(SIM_OBJS)
647 @echo "...Linking for Simulator Target..."
648 $(SIM_LD) --entry 0 -o $(SIM_LINKER_OUTPUT) $(SIM_OBJS) $(SLD_SIM_OBJ) $(SIM_LDFLAGS) $(SIM_LIBS)
651 # Final target creation
652 $(TARGET): $(SLD_OBJ) $(LINKER_OUTPUT) $(RESOURCE_OBJS)
653 @echo "...Creating PRC for Device: $(TARGET)"
654 $(PELF2BIN) -format 6 -directory $(OBJ_DIR) -code acod -data adat -rsrc 0x0000 $(LINKER_OUTPUT)
655 $(PRCMERGE) -dbType '$(DB_TYPE)' -dbCreator '$(CREATOR_ID)' -dbName $(DATABASE_NAME) $(PRCFLAGS) -o $(TARGET) $(RESOURCE_OBJS) $(OBJ_DIR)/adat0000.bin $(OBJ_DIR)/acod0000.bin
656 @echo ...Done with Device build...
659 $(SIM_TARGET): $(SLD_SIM_OBJ) $(SIM_LINKER_OUTPUT) $(RESOURCE_OBJS)
660 @echo "...Creating PRC for Simulator: $(SIM_TARGET)"
661 cp -f "$(SDK_LOCATION)misctools/Resources/amdd_fake" $(SIM_OBJ_DIR)/adat0000.bin
662 $(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
663 @echo ...Done with Simulator build...
666 $(STATIC_LIB_TARGET) : $(OBJS)
667 @echo "...Linking Static Library for Device Target..."
668 $(AR) $(ARFLAGS) $(STATIC_LIB_TARGET) $(OBJS)
670 $(SIM_STATIC_LIB_TARGET) : $(SIM_OBJS)
671 @echo "...Linking Static Library for Simulator Target..."
672 $(SIM_AR) $(SIM_ARFLAGS) $(SIM_STATIC_LIB_TARGET) $(SIM_OBJS)
677 # Eclipse requires a clean command
679 -rm -rf $(NATIVE_OBJ_DIR)/*
684 @echo $(SDK_LOCATION)
706 @echo $(SOURCE_PATHS)
707 @echo "RESOURCE_OBJS"
708 @echo $(RESOURCE_OBJS)
709 @echo "RESOURCE_PATHS"
710 @echo $(RESOURCE_PATHS)
717 @echo "LINKER_OUTPUT"
718 @echo $(LINKER_OUTPUT)
719 @echo "SIM_LINKER_OUTPUT"
720 @echo $(SIM_LINKER_OUTPUT)
721 @echo "SIM_GCC_SLIBS"
722 @echo $(SIM_GCC_SLIBS)
723 @echo "SIM_GCC_SLIB_PATHS"
724 @echo $(SIM_GCC_SLIB_PATHS)
730 # dependency generation
731 # Generate dependencies with depend target "make depend"
737 # Adds $(SIM_OBJ_DIR) to target .o file
738 # ...Search for string starting at the beginning of the line [^]
739 # ...that contain anything followed by .o [.*\.o]
740 # ...and remember that string [\(...\)]
741 # ...replace that string with $(SIM_OBJ_DIR)/<tagged string> [$$(SIM_OBJ_DIR)/\1]
742 # ($ is doubled so that make doesn't interpret the variable syntax)
744 SOURCE_SEDSCRIPT = sed -e's%^\(.*\.o\)%$$(OBJ_DIR)/\1%'
745 SOURCE_SIM_SEDSCRIPT = sed -e's%^\(.*\.o\)%$$(SIM_OBJ_DIR)/\1%'
747 # Command adds $(RSC_OBJ_DIR) and converts .xrd to .trc
748 RESOURCE_TARGET_SEDSCRIPT = sed -e';s%^\(.*\).xrd%$$(RSC_OBJ_DIR)/\1.trc%'
750 # Command to escape spaces in a path
751 ESCAPE_SPACES_SEDSCRIPT = sed 's/ /\\\ /g'
753 # Take out all newlines (and/or returns) and replace with spaces
754 # ...putting all dependencies on the same line
755 RESOURCE_PREREQ_SEDSCRIPT = tr '\r\n' ' '
758 @echo "" > $(FN_DEPEND)
759 # @echo "$(SIM_CC) $(SIM_CXXFLAGS) $(DEPFLAG) $(SOURCES) to $(FN_DEPEND).tmp"
760 @$(SIM_CC) $(SIM_CXXFLAGS) $(DEPFLAG) $(SOURCES) > $(FN_DEPEND).tmp
761 @cat $(FN_DEPEND).tmp | $(SOURCE_SEDSCRIPT) >> $(FN_DEPEND)
762 @cat $(FN_DEPEND).tmp | $(SOURCE_SIM_SEDSCRIPT) >> $(FN_DEPEND)
763 -rm -f $(FN_DEPEND).tmp
764 @for i in $(RESOURCES); do \
765 echo "$$i: \\" | $(RESOURCE_TARGET_SEDSCRIPT) >> .resdependencies; \
766 $(PALMRC) -p $(TARGET_FORMAT) $(RFLAGS) -locale $(LOCALE) -makedeps $$i.tmp "`$(CYGPATH_WA) ./$$i`"; \
767 $(CYGPATH_MF) $$i.tmp | $(ESCAPE_SPACES_SEDSCRIPT) >> $$i.deps; \
769 cat $$i.deps | $(RESOURCE_PREREQ_SEDSCRIPT) >> .resdependencies; \
770 echo "" >> .resdependencies; \
772 cat .resdependencies >> $(FN_DEPEND); \
773 rm -rf .resdependencies; \
775 @for i in $(SOURCES); do \
776 echo "`basename $$i`.o: $$i" | $(SOURCE_SEDSCRIPT) | sed "s/\.cpp\.o/.o/" | sed "s/\.c\.o/.o/" >> $(FN_DEPEND); \
777 echo " \$$(CC) -c \$$< \$$(CXXFLAGS) -o \$$@" >> $(FN_DEPEND); \
778 echo "`basename $$i`.o: $$i" | $(SOURCE_SIM_SEDSCRIPT) | sed "s/\.cpp\.o/.o/" | sed "s/\.c\.o/.o/" >> $(FN_DEPEND); \
779 echo " \$$(SIM_CC) -c \$$< \$$(CXXFLAGS) -o \$$@" >> $(FN_DEPEND); \
782 $(FN_DEPEND).1: $(FN_DEPEND)
783 @touch $(FN_DEPEND).1
786 $(FN_DEPEND): #makefile #$(SOURCES)
787 @rm -f $(FN_DEPEND).2
789 @cp $(FN_DEPEND) $(FN_DEPEND).2
792 @rm -f $(FN_DEPEND) $(FN_DEPEND).1 $(FN_DEPEND).2 $(FN_DEPEND).tmp
793 @rm -f $(INCDIR_WXPALM)/wx/setup.h
795 distclean: cleandepend clean
797 -include $(FN_DEPEND).2