[ASM]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 15 Sep 2015 01:59:14 +0000 (01:59 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 15 Sep 2015 01:59:14 +0000 (01:59 +0000)
Fix the file header description. Consistently use .endm for closing a macro started with .macro.

[NTVDM]
- Add "_clean" targets to generated asm16 targets.
- Fix CMake dependency generation in a somewhat hackish way: I don't know how to cleanly specify the location of generated files for custom targets. And it is also hackish because in a CMake custom command which depends on the COMMAND.COM target, I also need to explicitely say that the command depends on the output file created by the COMMAND.COM target...
- Add COMMAND.COM to the CD files, even if NTVDM doesn't use an external command.com for now. CORE-5221

svn path=/trunk/; revision=69234

reactos/include/asm/asm.inc
reactos/subsystems/mvdm/asm16.cmake
reactos/subsystems/mvdm/dos/CMakeLists.txt
reactos/subsystems/mvdm/ntvdm/CMakeLists.txt

index d81db8b..07206cf 100644 (file)
@@ -1,7 +1,7 @@
 /*\r
  * COPYRIGHT:       See COPYING in the top level directory\r
  * PROJECT:         ReactOS Kernel\r
- * FILE:            ntoskrnl/include/amd64/asmmacro.S\r
+ * FILE:            include/asm/asm.inc\r
  * PURPOSE:         ASM macros for GAS and MASM/ML64\r
  * PROGRAMMERS:     Timo Kreuzer (timo.kreuzer@reactos.org)\r
  */\r
@@ -315,15 +315,14 @@ code = 1
 \r
 .macro absolute address\r
     __absolute__address__ = \address\r
-ENDM\r
+.endm\r
 \r
 .macro resb name, size\r
     \name = __absolute__address__\r
     __absolute__address__ = __absolute__address__ + \size\r
-ENDM\r
+.endm\r
 \r
 .macro UNIMPLEMENTED2 file, line, func\r
-\r
     jmp 3f\r
 1:  .asciz "\func"\r
 2:  .asciz \file\r
index 5c08a2a..b60bb4a 100644 (file)
@@ -38,6 +38,7 @@ function(add_asm16_bin _target _binary_file _base_address)
     # many ASM files is by concatenating them into a single one and
     # compile the resulting file.
     concatenate_files(${_concatenated_asm_file} ${_source_file_list})
+    set_source_files_properties(${_concatenated_asm_file} PROPERTIES GENERATED TRUE)
 
     ##
     ## All this part is the same as CreateBootSectorTarget
@@ -53,9 +54,11 @@ function(add_asm16_bin _target _binary_file _base_address)
         # COMMAND objcopy --output-target binary --image-base 0x${_base_address} ${_object_file} ${_binary_file}
         DEPENDS ${_object_file} native-obj2bin)
 
-    set_source_files_properties(${_object_file} ${_binary_file} PROPERTIES GENERATED TRUE)
-
     add_custom_target(${_target} ALL DEPENDS ${_binary_file})
+    # set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${_target} SUFFIX ".bin")
+    set_target_properties(${_target} PROPERTIES LOCATION_${CMAKE_BUILD_TYPE} ${_binary_file}) ## Support of $<TARGET_FILE:xxx> is limited to add_executable() or add_library()
+    set_target_properties(${_target} PROPERTIES LOCATION ${_binary_file})                     ## Support of $<TARGET_FILE:xxx> is limited to add_executable() or add_library()
+    add_clean_target(${_target})
 endfunction()
 
 else()
@@ -93,6 +96,7 @@ function(add_asm16_bin _target _binary_file _base_address)
     # many ASM files is by concatenating them into a single one and
     # compile the resulting file.
     concatenate_files(${_concatenated_asm_file} ${_source_file_list})
+    set_source_files_properties(${_concatenated_asm_file} PROPERTIES GENERATED TRUE)
 
     ##
     ## All this part is the same as CreateBootSectorTarget
@@ -113,9 +117,11 @@ function(add_asm16_bin _target _binary_file _base_address)
         COMMAND native-obj2bin ${_object_file} ${_binary_file} ${_base_address}
         DEPENDS ${_object_file} native-obj2bin)
 
-    set_source_files_properties(${_object_file} ${_preprocessed_asm_file} ${_binary_file} PROPERTIES GENERATED TRUE)
-
     add_custom_target(${_target} ALL DEPENDS ${_binary_file})
+    # set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${_target} SUFFIX ".bin")
+    set_target_properties(${_target} PROPERTIES LOCATION_${CMAKE_BUILD_TYPE} ${_binary_file}) ## Support of $<TARGET_FILE:xxx> is limited to add_executable() or add_library()
+    set_target_properties(${_target} PROPERTIES LOCATION ${_binary_file})                     ## Support of $<TARGET_FILE:xxx> is limited to add_executable() or add_library()
+    add_clean_target(${_target})
 endfunction()
 
 endif()
index bd81c47..bf7f563 100644 (file)
@@ -1,3 +1,4 @@
 
 include_directories(${REACTOS_SOURCE_DIR}/subsystems/mvdm/dos)
 add_asm16_bin(command ${CMAKE_CURRENT_BINARY_DIR}/command.com 0x0100 command.S)
+add_cd_file(TARGET command DESTINATION reactos/system32 FOR all)
index baa0327..e6e7cfe 100644 (file)
@@ -4,10 +4,14 @@ PROJECT(NTVDM)
 #####################################
 # Generate the integrated COMMAND.COM
 #
+
+# Retrieve the full path to the generated file of the 'command' target
+get_target_property(_command_com_file command LOCATION)
+
 add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_com.c ${CMAKE_CURRENT_BINARY_DIR}/command_com.h
-    COMMAND native-bin2c ${CMAKE_CURRENT_BINARY_DIR}/../dos/command.com ${CMAKE_CURRENT_BINARY_DIR}/command_com.c ${CMAKE_CURRENT_BINARY_DIR}/command_com.h BIN CommandCom
-    DEPENDS native-bin2c command)
+    COMMAND native-bin2c ${_command_com_file} ${CMAKE_CURRENT_BINARY_DIR}/command_com.c ${CMAKE_CURRENT_BINARY_DIR}/command_com.h BIN CommandCom
+    DEPENDS native-bin2c command ${_command_com_file})
 #####################################
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/fast486)