Re: target-map considered harmful
Matthew Fluet <[email protected]>
| Newsgroups | gmane.comp.lang.ml.mlton.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jan 7, 2010 at 5:36 PM, Wesley W. Terpstra <[email protected]> wrote: > On Wed, Jan 6, 2010 at 3:50 PM, Matthew Fluet <[email protected]> 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@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.