[MLton] target-map considered harmful
Matthew Fluet
matthew.fluet at gmail.com
Mon Jan 11 10:49:02 PST 2010
On Thu, Jan 7, 2010 at 5:36 PM, Wesley W. Terpstra <wesley at terpstra.ca> wrote:
> On Wed, Jan 6, 2010 at 3:50 PM, Matthew Fluet <matthew.fluet at gmail.com> wrote:
>> That seems like a fine solution. I would suggest that we put all of
>> the targets within a single "target" directory of the lib directory.
>> That would make it easy to find all the targets.
>>
>> It might also be good to move the c-types.sml file into the
>> target-specific directory. Then a target would be entirely self
>> contained.
>
> I've attached a patch which does this and committed two orthogonal
> (but necessary) changes to svn/HEAD.
>
> As you can see in the patch, I've moved the target directories into a
> 'targets' sub-folder in the mlton lib directory. The OS and
> Architecture are listed in the files 'os' and 'arch' respectively in
> the appropriate target folder. Finally, I moved c-types.sml into an
> 'sml' folder for the given target. The directory layout looks now
> like:
>
> terpstra at orange:~/mlton/build/lib$ find targets/
> targets/
> targets/self
> targets/self/sml
> targets/self/sml/c-types.sml
> targets/self/include
> targets/self/include/c-types.h
> targets/self/arch
> targets/self/libgdtoa.a
> targets/self/libgdtoa-pic.a
> targets/self/constants
> targets/self/libmlton.a
> targets/self/sizes
> targets/self/libgdtoa-gdb.a
> targets/self/os
> targets/self/libmlton-pic.a
> targets/self/libmlton-gdb.a
>
> Most of the changes were to the Makefile.
Looks very good. My only suggestion might be to change the
../../../targets/$(TARGET)/sml/c-types.sml
to
$(LIB_MLTON_DIR)/targets/$(TARGET)/sml/c-types.sml
just because it seems more natural to think of the targets directory
as relative to the lib/mlton directory than relative to the basis
library directory. Also, it is helpful to be able to type-check the
basis library from within the <src>/basis-library directory without
installing it into the build/lib/sml/basis directory.
More information about the MLton
mailing list