Changeset 99 for trunk/libjdkmidi/trunk
- Timestamp:
- 09/07/06 16:35:45 (2 years ago)
- Files:
-
- 1 modified
-
trunk/libjdkmidi/trunk/magic.mak (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libjdkmidi/trunk/magic.mak
r98 r99 11 11 12 12 13 # this first target, 'everything' is a placeholder which makes the required subdirectories and then 14 # calls make again with the required directories made. Since these subdirectories are part of the 15 # search paths, make must see them when invoked otherwise it gets confused. 16 17 .PHONY : everything 18 19 ifeq ($(CROSS_COMPILING),1) 20 everything : native_dirs dirs 21 @$(MAKE) all 22 else 23 everything : dirs 24 @$(MAKE) all 25 endif 26 27 13 28 # default project settings. These are usually originally set in project.mak 14 29 … … 213 228 # all source files in a specified directory class and construct the o file lists for them. 214 229 # Param $(1) is the class of program in capitals, for example TOOLS, TESTS, EXAMPLES, GUI 230 # Param $(2) is the lowercase directory name that these source files live in. $(2) is also 231 # used as the make target for the exe files in this class. 215 232 # the text returned by this function is then to be eval'd. The appropriate lists of 216 233 # source files and O files for this class are then created dynamically. 217 234 218 235 define search_program_group 236 LIB_$(1)_DIR+=$$(call target_suffix_platform_dirs,$(2)) 237 238 219 239 LIB_$(1)_CPP_FILES=$$(call get_file_list,$$(LIB_$(1)_DIR),cpp) 220 240 LIB_$(1)_CC_FILES=$$(call get_file_list,$$(LIB_$(1)_DIR),cc) … … 231 251 LIB_$(1)_EXE_FILES=$$(addprefix $$(OUTPUT_$(1)_DIR)/,$$(notdir $$(LIB_$(1)_O_FILES:.o=$$(EXE)))) 232 252 233 ifeq ($(CROSS_COMPILING),1) 253 OUTPUT_$(1)_DIR?=$$(OUTPUT_DIR)/$(2) 254 255 ALL_OUTPUT_DIRS+=$$(OUTPUT_DIR)/$(2) 256 257 .PHONY : $(2) 258 259 $(2) : lib $$(LIB_$(1)_EXE_FILES) config-tool 260 261 $$(LIB_$(1)_EXE_FILES) : $$(OUTPUT_LIB) 262 263 ifeq ($(CROSS_COMPILING),1) 264 265 NATIVE_LIB_$(1)_DIR+=$$(call native_suffix_platform_dirs,$(2)) 266 234 267 NATIVE_LIB_$(1)_CPP_FILES=$$(call get_file_list,$$(NATIVE_LIB_$(1)_DIR),cpp) 235 268 NATIVE_LIB_$(1)_CC_FILES=$$(call get_file_list,$$(NATIVE_LIB_$(1)_DIR),cc) … … 238 271 NATIVE_LIB_$(1)_SH_FILES=$$(call get_file_list,$$(NATIVE_LIB_$(1)_DIR),sh) 239 272 240 NATIVE_LIB_ TOOLS_O_FILES=$$(call get_native_cpp_o_files,$$(NATIVE_LIB_$(1)_CPP_FILES)) \273 NATIVE_LIB_$(1)_O_FILES=$$(call get_native_cpp_o_files,$$(NATIVE_LIB_$(1)_CPP_FILES)) \ 241 274 $$(call get_native_cc_o_files,$$(NATIVE_LIB_$(1)_CC_FILES)) \ 242 275 $$(call get_native_c_o_files,$$(NATIVE_LIB_$(1)_C_FILES)) \ … … 245 278 246 279 NATIVE_LIB_$(1)_EXE_FILES=$$(addprefix $$(NATIVE_OUTPUT_$(1)_DIR)/,$$(notdir $$(NATIVE_LIB_$(1)_O_FILES:.o=$$(NATIVE_EXE)))) 247 endif 280 281 NATIVE_OUTPUT_$(1)_DIR?=$$(NATIVE_OUTPUT_DIR)/$(2) 282 283 NATIVE_ALL_OUTPUT_DIRS+=$$(NATIVE_OUTPUT_DIR)/$(2) 284 285 .PHONY : native_$(1) 286 287 native-$(2) : native-lib $$(NATIVE_LIB_$(1)_EXE_FILES) 288 289 $$(NATIVE_LIB_$(1)_EXE_FILES) : $(NATIVE_OUTPUT_LIB) 290 endif 291 292 248 293 endef 249 294 … … 412 457 LIB_INCLUDE_DIR+=$(call target_suffix_platform_dirs,include) 413 458 LIB_SRC_DIR+=$(call target_suffix_platform_dirs,src) 414 LIB_TESTS_DIR+=$(call target_suffix_platform_dirs,tests)415 LIB_GUI_DIR+=$(call target_suffix_platform_dirs,gui)416 LIB_EXAMPLES_DIR+=$(call target_suffix_platform_dirs,examples)417 LIB_TOOLS_DIR+=$(call target_suffix_platform_dirs,tools)418 459 LIB_DOCS_DIR+=$(call target_suffix_platform_dirs,docs) 419 460 … … 421 462 OUTPUT_DIR=$(BUILD_DIR)/build 422 463 OUTPUT_LIB_DIR?=$(OUTPUT_DIR)/lib 423 OUTPUT_TESTS_DIR?=$(OUTPUT_DIR)/tests424 464 OUTPUT_DOCS_DIR?=$(OUTPUT_DIR)/docs 425 OUTPUT_TOOLS_DIR?=$(OUTPUT_DIR)/tools426 OUTPUT_GUI_DIR?=$(OUTPUT_DIR)/gui427 OUTPUT_EXAMPLES_DIR?=$(OUTPUT_DIR)/examples428 465 OUTPUT_OBJ_DIR?=$(OUTPUT_DIR)/obj 429 466 … … 439 476 INSTALL_DOCS_DIR?=$(INSTALL_DIR)/share/$(PROJECT)-$(PROJECT_VERSION) 440 477 441 ALL_OUTPUT_DIRS+=$(OUTPUT_LIB_DIR) $(OUTPUT_TOOLS_DIR) $(OUTPUT_TESTS_DIR) $(OUTPUT_DOCS_DIR) $(OUTPUT_EXAMPLES_DIR) $(OUTPUT_OBJ_DIR) $(OUTPUT_GUI_DIR) 442 443 478 ALL_OUTPUT_DIRS+=$(OUTPUT_LIB_DIR) $(OUTPUT_DOCS_DIR) $OUTPUT_OBJ_DIR) 444 479 445 480 NATIVE_USE_AR?=1 … … 516 551 # calculate our output directories for our native platform results 517 552 553 NATIVE_LIB_SRC_DIR+=$(call native_suffix_platform_dirs,src) 554 518 555 NATIVE_OUTPUT_DIR=$(NATIVE_BUILD_DIR)/native 519 556 NATIVE_OUTPUT_LIB_DIR?=$(NATIVE_OUTPUT_DIR)/lib 520 NATIVE_OUTPUT_TESTS_DIR?=$(NATIVE_OUTPUT_DIR)/tests521 557 NATIVE_OUTPUT_DOCS_DIR?=$(NATIVE_OUTPUT_DIR)/docs 522 NATIVE_OUTPUT_TOOLS_DIR?=$(NATIVE_OUTPUT_DIR)/tools523 NATIVE_OUTPUT_EXAMPLES_DIR?=$(NATIVE_OUTPUT_DIR)/examples524 558 NATIVE_OUTPUT_OBJ_DIR?=$(NATIVE_OUTPUT_DIR)/obj 525 559 526 560 NATIVE_OUTPUT_LIB?=$(NATIVE_OUTPUT_LIB_DIR)/lib$(PROJECT).a 527 561 528 529 NATIVE_LIB_SRC_DIR+=$(call native_suffix_platform_dirs,tests) 530 NATIVE_LIB_TESTS_DIR+=$(call native_suffix_platform_dirs,tests) 531 NATIVE_LIB_GUI_DIR+=$(call native_suffix_platform_dirs,gui) 532 NATIVE_LIB_EXAMPLES_DIR+=$(call native_suffix_platform_dirs,examples) 533 NATIVE_LIB_TOOLS_DIR+=$(call native_suffix_platform_dirs,tools) 534 535 536 NATIVE_ALL_OUTPUT_DIRS+=$(NATIVE_OUTPUT_LIB_DIR) $(NATIVE_OUTPUT_TOOLS_DIR) $(NATIVE_OUTPUT_TESTS_DIR) $(NATIVE_OUTPUT_DOCS_DIR) $(NATIVE_OUTPUT_EXAMPLES_DIR) $(NATIVE_OUTPUT_OBJ_DIR) 562 NATIVE_ALL_OUTPUT_DIRS+=$(NATIVE_OUTPUT_LIB_DIR) $(NATIVE_OUTPUT_DOCS_DIR) $(NATIVE_OUTPUT_OBJ_DIR) 537 563 538 564 … … 546 572 vpath %.o $(OUTPUT_OBJ_DIR) 547 573 548 # all source files in all of our src,tests,e cxamples,tools,gui dirs574 # all source files in all of our src,tests,examples,tools,gui dirs 549 575 vpath %.m $(LIB_SRC_DIR) $(LIB_TESTS_DIR) $(LIB_EXAMPLES_DIR) $(LIB_TOOLS_DIR) $(LIB_GUI_DIR) 550 576 vpath %.mm $(LIB_SRC_DIR) $(LIB_TESTS_DIR) $(LIB_EXAMPLES_DIR) $(LIB_TOOLS_DIR) $(LIB_GUI_DIR) … … 752 778 # get the list of tool program source files from the tools directories 753 779 754 $(eval $(call search_program_group,TOOLS ))780 $(eval $(call search_program_group,TOOLS,tools)) 755 781 756 782 # get the list of test program source files from the tests directories 757 783 758 $(eval $(call search_program_group,TESTS ))784 $(eval $(call search_program_group,TESTS,tests)) 759 785 760 786 # get the list of example program source files from the examples directories 761 787 762 $(eval $(call search_program_group,EXAMPLES ))788 $(eval $(call search_program_group,EXAMPLES,examples)) 763 789 764 790 # get the list of example program source files from the gui directories 765 791 766 $(eval $(call search_program_group,GUI ))792 $(eval $(call search_program_group,GUI,gui)) 767 793 768 794 769 795 770 796 # manipulate these file lists to create our desired output files in the proper place 771 772 # this first target, 'everything' is a placeholder which makes the required subdirectories and then773 # calls make again with the required directories made. Since these subdirectories are part of the774 # search paths, make must see them when invoked otherwise it gets confused.775 776 .PHONY : everything777 778 ifeq ($(CROSS_COMPILING),1)779 everything : native_dirs dirs780 @$(MAKE) all781 else782 everything : dirs783 @$(MAKE) all784 endif785 786 797 787 798 … … 817 828 endif 818 829 819 820 821 .PHONY : tools822 823 tools : lib $(LIB_TOOLS_EXE_FILES) config-tool824 825 $(LIB_TOOLS_EXE_FILES) : $(OUTPUT_LIB)826 827 .PHONY : examples828 829 examples: lib $(LIB_EXAMPLES_EXE_FILES)830 831 $(LIB_EXAMPLES_EXE_FILES) : $(OUTPUT_LIB)832 833 .PHONY : tests834 835 tests: lib $(LIB_TESTS_EXE_FILES)836 837 $(LIB_TESTS_EXE_FILES) : $(OUTPUT_LIB)838 839 840 gui: lib $(LIB_GUI_EXE_FILES)841 842 $(LIB_GUI_EXE_FILES) : $(OUTPUT_LIB)843 830 844 831 .PHONY : install … … 934 921 935 922 936 .PHONY : native_tools937 938 native-tools : native-lib $(NATIVE_LIB_TOOLS_EXE_FILES)939 940 $(NATIVE_LIB_TOOLS_EXE_FILES) : $(NATIVE_OUTPUT_LIB)941 942 .PHONY : native-examples943 944 native-examples: native-lib $(NATIVE_LIB_EXAMPLES_EXE_FILES)945 946 $(NATIVE_LIB_EXAMPLES_EXE_FILES) : $(NATIVE_OUTPUT_LIB)947 948 .PHONY : native-tests949 950 native-tests: native-lib $(NATIVE_LIB_TESTS_EXE_FILES)951 952 $(NATIVE_LIB_TESTS_EXE_FILES) : $(NATIVE_OUTPUT_LIB)953 923 954 924 .PHONY : native-test … … 998 968 @echo "RANLIB : $(RANLIB)" 999 969 @echo "COMPILE_FLAGS: $(COMPILE_FLAGS)" 970 @echo "DEFINES: $(DEFINES)" 1000 971 @echo "LINK_FLAGS: $(LINK_FLAGS)" 1001 972 @echo "LDLIBS: $(LDLIBS)"
