Blob Blame History Raw
lz_project_rules()
{
	lz_rules="all install xstatic install_xstatic"
}

lz_project_definitions()
{
	dalist_lib_name=libdalist
	dalist_so_name="$lz_build_dir/lib/$dalist_lib_name$lz_dylib_ext"
	dalist_a_name="$lz_build_dir/lib/$dalist_lib_name$lz_stlib_ext"
	dalist_so_def_name="$lz_build_dir/lib/$dalist_lib_name$lz_libdef_ext"
	dalist_implib_name="$lz_build_dir/lib/$dalist_lib_name$lz_implib_ext"

	lz_cflags_common="-DMIDIPIX_FREESTANDING
			-D__NT$lz_arch_bits \
			-UWIN32 -U_WIN32 -U__WIN32__ -UWIN64 -U_WIN64 -U__WIN64__ \
			-Werror=all -fno-builtin -ffreestanding"


	# lz_cflags_extra="-Os -fno-stack-protector -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables"
				
	dalist_so_ldflags="-shared --image-base=0x320000 \
				--entry "$lz_default_underscore"dalist_lib_entry_point@12 \
				--exclude-all-symbols \
				--output-def $dalist_so_def_name \
				--out-implib $dalist_implib_name \
				--subsystem=windows"

	lz_cflags_include_common="-I$lz_project_dir/include"

	if [ "$MIDIPIX_ROOT"x != x ]; then
		lz_cflags_include_common="$lz_cflags_include_common -I$MIDIPIX_ROOT/include"
	fi

	dalist_so_obj_list=dalist.so.objs
	dalist_so_src_list=dalist.so.src.lst

	dalist_a_obj_list=dalist.a.objs
	dalist_a_src_list=dalist.a.src.lst
}

dalist_shared()
{
	lz_src_dirs="src"
	lz_cflags_step="-DDALIST_BUILD"

	if ! [ "$lz_pecoff_winnt"x = yesx ]; then
		lz_cflags_step="$lz_cflags_step -fpic"
	fi	

	lz_compile "$dalist_so_obj_list" "$dalist_so_src_list" "$lz_dyobj_ext"
        lz_link    "$dalist_so_obj_list" "$dalist_so_src_list" "$dalist_so_name" \
			"$dalist_so_ldflags" \
			''
}


dalist_static()
{
	lz_src_dirs="src"

	lz_compile "$dalist_a_obj_list" "$dalist_a_src_list" "$lz_stobj_ext"
        lz_archive "$dalist_a_obj_list" "$dalist_a_src_list" "$dalist_a_name"
}


dalist_xstatic()
{
	lz_src_dirs="src"
	lz_cflags_step="-DDALIST_BUILD"

	lz_compile "$dalist_a_obj_list" "$dalist_a_src_list" "$lz_stobj_ext"
        lz_archive "$dalist_a_obj_list" "$dalist_a_src_list" "$dalist_a_name"
}


dalist_install_headers()
{
	lz_pushd $lz_project_dir

	cp -r -t $lz_prefix/include include/$lz_project_name

	lz_popd
}


dalist_install_shared()
{
	lz_pushd $lz_build_dir/lib

	cp -t $lz_prefix/lib $dalist_lib_name$lz_dylib_ext
	cp -t $lz_prefix/lib $dalist_lib_name$lz_implib_ext

	lz_popd
}


dalist_install_static()
{
	lz_pushd $lz_build_dir/lib

	cp -t $lz_prefix/lib $dalist_lib_name$lz_stlib_ext

	lz_popd
}

dalist_install_xstatic()
{
	lz_step dalist_xstatic
	lz_step dalist_install_static
}


dalist_all()
{
	lz_step dalist_shared
	lz_step dalist_static
}


dalist_install()
{
	lz_step dalist_all
	lz_step dalist_install_shared
	lz_step dalist_install_static
	lz_step dalist_install_headers
}