# HG changeset patch # User Rob Landley # Date 1170271085 18000 # Node ID 4f5cdc6552dac6fb2453964e6e0dd03876382511 # Parent 021fe1a818c3f8277523341c02e1907746447386 Add make install_flat. diff -r 021fe1a818c3 -r 4f5cdc6552da Makefile --- a/Makefile Wed Jan 31 13:31:19 2007 -0500 +++ b/Makefile Wed Jan 31 14:18:05 2007 -0500 @@ -43,8 +43,17 @@ toybox: toybox_unstripped $(STRIP) toybox_unstripped -o toybox + +instlist: toybox + $(HOST_CC) -I . scripts/install.c -o instlist + +install_flat: instlist + @mkdir -p $(PREFIX)/ + @cp toybox $(PREFIX)/ + @for i in `./instlist`; do ln -s toybox "$(PREFIX)/$$i"; done + clean:: - rm -f toybox toybox_old toybox_unstripped gen_config.h + rm -f toybox toybox_old toybox_unstripped gen_config.h instlist distclean: clean rm -f .config* diff -r 021fe1a818c3 -r 4f5cdc6552da scripts/install.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/install.c Wed Jan 31 14:18:05 2007 -0500 @@ -0,0 +1,40 @@ +/* vi: set ts=4 :*/ +/* Wrapper to make installation easier with cross-compiling. + * + * Copyright 2006 Rob Landley + */ + +#include "toys.h" + +#undef NEWTOY +#undef OLDTOY +#define NEWTOY(name, opts, flags) {#name, 0, opts, flags}, +#define OLDTOY(name, oldname, opts, flags) {#name, 0, opts, flags} + +// Populate toy_list[]. + +struct toy_list toy_list[] = { +#include "toys/toylist.h" +}; + +#define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list)) + +int main(int argc, char *argv[]) +{ + static char *toy_paths[]={"usr/","bin/","sbin/",0}; + int i, len = 0; + + // Output list of applets. + for (i=1; i1) { + int j; + for (j=0; toy_paths[j]; j++) + if (fl & (1<