summaryrefslogtreecommitdiffhomepage
path: root/project
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-09-26 01:14:54 -0400
committermidipix <writeonce@midipix.org>2015-09-26 15:27:42 -0400
commit7b83a9160796bf2b80126655860096d4bec7f6ed (patch)
treee453071f8d6dfc8b225da60bd1f1bd8dc51ac6fc /project
parent275c478e45cf4bf74f82571afe5e5903e088a746 (diff)
downloadntapi-7b83a9160796bf2b80126655860096d4bec7f6ed.tar.bz2
ntapi-7b83a9160796bf2b80126655860096d4bec7f6ed.tar.xz
makefile replacement: step 2/2: use the midipix build template.
Diffstat (limited to 'project')
-rw-r--r--project/arch.mk13
-rw-r--r--project/common.mk103
-rw-r--r--project/defs.mk31
-rw-r--r--project/depends.mk0
-rw-r--r--project/extras.mk16
-rw-r--r--project/headers.mk77
-rw-r--r--project/overrides.mk0
-rw-r--r--project/tree.mk26
8 files changed, 266 insertions, 0 deletions
diff --git a/project/arch.mk b/project/arch.mk
new file mode 100644
index 0000000..36202e2
--- /dev/null
+++ b/project/arch.mk
@@ -0,0 +1,13 @@
+# mingw
+ifeq ($(ARCH),w32)
+ ARCH = nt32
+else ifeq ($(ARCH),w64)
+ ARCH = nt64
+endif
+
+# process
+src/process/%.lo: $(PROJECT_DIR)/src/process/$(ARCH)/%.s $(ALL_HEADERS) host.tag
+ $(CC) -c -o $@ $<
+
+src/process/%.o: $(PROJECT_DIR)/src/process/$(ARCH)/%.s $(ALL_HEADERS) host.tag
+ $(CC) -c -o $@ $<
diff --git a/project/common.mk b/project/common.mk
new file mode 100644
index 0000000..abbbb20
--- /dev/null
+++ b/project/common.mk
@@ -0,0 +1,103 @@
+COMMON_SRCS = \
+ src/argv/ntapi_tt_argv_envp.c \
+ src/argv/ntapi_tt_array_utf16.c \
+ src/argv/ntapi_tt_array_utf8.c \
+ src/argv/ntapi_tt_env_vars.c \
+ src/argv/ntapi_tt_get_option.c \
+ src/blitter/ntapi_blt_alloc.c \
+ src/blitter/ntapi_blt_block.c \
+ src/blitter/ntapi_blt_free.c \
+ src/daemon/ntapi_dsr_init.c \
+ src/daemon/ntapi_dsr_internal_connection.c \
+ src/fs/ntapi_tt_get_file_handle_type.c \
+ src/fs/ntapi_tt_istat.c \
+ src/fs/ntapi_tt_mount.c \
+ src/fs/ntapi_tt_open_logical_parent_directory.c \
+ src/fs/ntapi_tt_open_physical_parent_directory.c \
+ src/fs/ntapi_tt_stat.c \
+ src/fs/ntapi_tt_statfs.c \
+ src/guid/ntapi_tt_guid.c \
+ src/hash/ntapi_tt_crc32.c \
+ src/hash/ntapi_tt_populate_hashed_import_table.c \
+ src/internal/ntapi.c \
+ src/internal/ntapi_debug.c \
+ src/internal/ntapi_entry_point.c \
+ src/ipc/ntapi_tt_create_pipe_v1.c \
+ src/ipc/ntapi_tt_create_pipe_v2.c \
+ src/ldr/ntapi_ldr_create_state_snapshot.c \
+ src/ldr/ntapi_ldr_load_system_dll.c \
+ src/ldr/ntapi_ldr_revert_state_to_snapshot.c \
+ src/object/ntapi_tt_keyed_object_directory.c \
+ src/port/ntapi_port_name_helper.c \
+ src/process/ntapi_tt_create_native_process_v1.c \
+ src/process/ntapi_tt_create_native_process_v2.c \
+ src/process/ntapi_tt_create_remote_process_params.c \
+ src/process/ntapi_tt_create_remote_runtime_data.c \
+ src/process/ntapi_tt_fork_v1.c \
+ src/process/ntapi_tt_fork_v2.c \
+ src/process/ntapi_tt_get_runtime_data.c \
+ src/process/ntapi_tt_init_runtime_data.c \
+ src/process/ntapi_tt_map_image_as_data.c \
+ src/process/tt_fork_v1.c \
+ src/pty/ntapi_pty_cancel.c \
+ src/pty/ntapi_pty_fd.c \
+ src/pty/ntapi_pty_io.c \
+ src/pty/ntapi_pty_ioctl.c \
+ src/pty/ntapi_pty_query.c \
+ src/pty/ntapi_pty_set.c \
+ src/section/ntapi_tt_get_section_name.c \
+ src/socket/ntapi_sc_accept.c \
+ src/socket/ntapi_sc_bind_v1.c \
+ src/socket/ntapi_sc_bind_v2.c \
+ src/socket/ntapi_sc_connect_v1.c \
+ src/socket/ntapi_sc_connect_v2.c \
+ src/socket/ntapi_sc_getsockname_v1.c \
+ src/socket/ntapi_sc_getsockname_v2.c \
+ src/socket/ntapi_sc_listen.c \
+ src/socket/ntapi_sc_recv.c \
+ src/socket/ntapi_sc_send.c \
+ src/socket/ntapi_sc_server_accept_connection_v1.c \
+ src/socket/ntapi_sc_server_accept_connection_v2.c \
+ src/socket/ntapi_sc_server_duplicate_socket.c \
+ src/socket/ntapi_sc_shutdown.c \
+ src/socket/ntapi_sc_socket_v1.c \
+ src/socket/ntapi_sc_socket_v2.c \
+ src/socket/ntapi_sc_wait.c \
+ src/string/ntapi_tt_aligned_block_memcpy.c \
+ src/string/ntapi_tt_aligned_block_memset.c \
+ src/string/ntapi_tt_aligned_memcpy_utf16.c \
+ src/string/ntapi_tt_hex_utf16_to_uintptr.c \
+ src/string/ntapi_tt_init_unicode_string_from_utf16.c \
+ src/string/ntapi_tt_memcpy_utf16.c \
+ src/string/ntapi_tt_string_null_offset.c \
+ src/string/ntapi_tt_uintptr_to_hex_utf16.c \
+ src/string/ntapi_tt_uintptr_to_hex_utf8.c \
+ src/sync/ntapi_tt_create_event.c \
+ src/sync/ntapi_tt_sync_block.c \
+ src/sync/ntapi_tt_wait_for_dummy_event.c \
+ src/system/ntapi_tt_get_csr_port_handle_addr_by_logic.c \
+ src/system/ntapi_tt_get_system_directory.c \
+ src/system/ntapi_tt_get_system_info_snapshot.c \
+ src/thread/ntapi_tt_create_thread.c \
+ src/tty/ntapi_tty_client_process_register.c \
+ src/tty/ntapi_tty_client_session_query.c \
+ src/tty/ntapi_tty_client_session_set.c \
+ src/tty/ntapi_tty_connect.c \
+ src/tty/ntapi_tty_create_session.c \
+ src/tty/ntapi_tty_join_session.c \
+ src/tty/ntapi_tty_query_information_server.c \
+ src/tty/ntapi_tty_request_peer.c \
+ src/tty/ntapi_tty_vms_query.c \
+ src/tty/ntapi_tty_vms_request.c \
+ src/unicode/ntapi_uc_unicode_conversion_from_utf16.c \
+ src/unicode/ntapi_uc_unicode_conversion_from_utf8.c \
+ src/unicode/ntapi_uc_unicode_validation.c \
+ src/vfd/ntapi_vfd_helper.c \
+ src/vmount/ntapi_vms_cache.c \
+ src/vmount/ntapi_vms_client_connect.c \
+ src/vmount/ntapi_vms_client_disconnect.c \
+ src/vmount/ntapi_vms_helper.c \
+ src/vmount/ntapi_vms_point_attach.c \
+ src/vmount/ntapi_vms_ref_count.c \
+ src/vmount/ntapi_vms_table_query.c \
+
diff --git a/project/defs.mk b/project/defs.mk
new file mode 100644
index 0000000..1f352be
--- /dev/null
+++ b/project/defs.mk
@@ -0,0 +1,31 @@
+SHARED_LIB_DEPS =
+SHARED_APP_DEPS =
+STATIC_APP_DEPS =
+
+COMMON_LOBJS = $(COMMON_SRCS:.c=.lo)
+COMMON_OBJS = $(COMMON_SRCS:.c=.o)
+
+ARCH_LOBJS = $(ARCH_SRCS:.c=.lo)
+ARCH_OBJS = $(ARCH_SRCS:.c=.o)
+
+SHARED_OBJS = $(COMMON_LOBJS) $(ARCH_LOBJS)
+STATIC_OBJS = $(COMMON_OBJS) $(ARCH_OBJS)
+
+SHARED_LIB = $(LIBDIR)/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_LIB_SUFFIX)
+STATIC_LIB = $(LIBDIR)/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_ARCHIVE_EXT)
+SHARED_IMPLIB = $(LIBDIR)/$(OS_LIB_PREFIX)$(PACKAGE)$(OS_IMPLIB_EXT)
+
+CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_CONFIG) $(CFLAGS_SYSROOT) \
+ $(CFLAGS_COMMON) $(CFLAGS_CMDLINE) $(CFLAGS_HOST) \
+ $(CFLAGS_PATH)
+
+CFLAGS_SHARED = $(CFLAGS) $(CFLAGS_PIC) $(CFLAGS_SHARED_ATTR)
+CFLAGS_STATIC = $(CFLAGS) $(CFLAGS_OBJ) $(CFLAGS_STATIC_ATTR)
+
+LDFLAGS_SHARED = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
+ $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
+ $(LDFLAGS_PATH) $(SHARED_LIB_DEPS) $(LDFLAGS_LAST)
+
+LDFLAGS_STATIC = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
+ $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
+ $(LDFLAGS_PATH) $(STATIC_APP_DEPS) $(LDFLAGS_LAST)
diff --git a/project/depends.mk b/project/depends.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/depends.mk
diff --git a/project/extras.mk b/project/extras.mk
new file mode 100644
index 0000000..338d3ac
--- /dev/null
+++ b/project/extras.mk
@@ -0,0 +1,16 @@
+CFLAGS_SHARED_ATTR += -DNTAPI_BUILD
+CFLAGS_STATIC_ATTR += -DNTAPI_STATIC
+
+CFLAGS_CONFIG += -DMIDIPIX_FREESTANDING -ffreestanding -D__NT$(HOST_BITS)
+CFLAGS_CONFIG += -UWIN32 -U_WIN32 -U__WIN32 -U__WIN32__
+CFLAGS_CONFIG += -UWIN64 -U_WIN64 -U__WIN64 -U__WIN64__
+
+LDFLAGS_SHARED += --out-implib $(SHARED_IMPLIB)
+LDFLAGS_SHARED += --exclude-all-symbols
+LDFLAGS_SHARED += -lpemagine -ldalist
+
+ifeq ($(HOST_BITS),32)
+ LDFLAGS_SHARED += --entry $(HOST_UNDERSCORE)__ntapi_entry_point@12
+else
+ LDFLAGS_SHARED += --entry $(HOST_UNDERSCORE)__ntapi_entry_point
+endif
diff --git a/project/headers.mk b/project/headers.mk
new file mode 100644
index 0000000..09b3e7c
--- /dev/null
+++ b/project/headers.mk
@@ -0,0 +1,77 @@
+API_HEADERS = \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_acl.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_argv.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_atom.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_atomic.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_auxv.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_blitter.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_crc32.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_daemon.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_debug.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_device.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_exception.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_file.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_fsctl.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_guid.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_hash.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_ioctl.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_ipc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_istat.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_job.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_ldr.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_locale.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_memory.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_mount.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_object.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_os.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_pnp.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_port.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_process.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_profiling.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_registry.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_section.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_security.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_slist.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_socket.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_stat.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_statfs.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_status.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_string.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_sync.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_sysinfo.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_termios.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_thread.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_time.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_token.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_tty.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_unicode.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_uuid.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_vfd.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./nt_vmount.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./ntapi.h \
+
+API_HEADERS_BITS = \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./bits/nt_atomic_inline_asm.h \
+
+API_HEADERS_I386 = \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./bits/i386/nt_atomic_i386_asm__gcc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./bits/i386/nt_atomic_i386_asm__msvc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./bits/i386/nt_thread_i386.h \
+
+API_HEADERS_X86_64 = \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./bits/x86_64/nt_atomic_x86_64_asm__gcc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./bits/x86_64/nt_atomic_x86_64_asm__msvc.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/./bits/x86_64/nt_thread_x86_64.h \
+
+INTERNAL_HEADERS = \
+ $(PROJECT_DIR)/src/internal/./ntapi_blitter.h \
+ $(PROJECT_DIR)/src/internal/./ntapi_context.h \
+ $(PROJECT_DIR)/src/internal/./ntapi_fnapi.h \
+ $(PROJECT_DIR)/src/internal/./ntapi_hash_table.h \
+ $(PROJECT_DIR)/src/internal/./ntapi_impl.h \
+ $(PROJECT_DIR)/src/internal/./ntapi_pty.h \
+
+ALL_HEADERS = $(API_HEADERS) $(INTERNAL_HEADERS) \
+ $(API_HEADERS_BITS) \
+ $(API_HEADERS_I386) \
+ $(API_HEADERS_X86_64) \
diff --git a/project/overrides.mk b/project/overrides.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/project/overrides.mk
diff --git a/project/tree.mk b/project/tree.mk
new file mode 100644
index 0000000..fd5144a
--- /dev/null
+++ b/project/tree.mk
@@ -0,0 +1,26 @@
+tree.tag:
+ mkdir -p src
+ mkdir -p src/argv
+ mkdir -p src/blitter
+ mkdir -p src/daemon
+ mkdir -p src/fs
+ mkdir -p src/guid
+ mkdir -p src/hash
+ mkdir -p src/internal
+ mkdir -p src/ipc
+ mkdir -p src/ldr
+ mkdir -p src/object
+ mkdir -p src/port
+ mkdir -p src/process
+ mkdir -p src/pty
+ mkdir -p src/section
+ mkdir -p src/socket
+ mkdir -p src/string
+ mkdir -p src/sync
+ mkdir -p src/system
+ mkdir -p src/thread
+ mkdir -p src/tty
+ mkdir -p src/unicode
+ mkdir -p src/vfd
+ mkdir -p src/vmount
+ touch tree.tag