comparison scripts/install.c @ 89:4f5cdc6552da

Add make install_flat.
author Rob Landley <rob@landley.net>
date Wed, 31 Jan 2007 14:18:05 -0500
parents
children b596b9b3b2af
comparison
equal deleted inserted replaced
88:021fe1a818c3 89:4f5cdc6552da
1 /* vi: set ts=4 :*/
2 /* Wrapper to make installation easier with cross-compiling.
3 *
4 * Copyright 2006 Rob Landley <rob@landley.net>
5 */
6
7 #include "toys.h"
8
9 #undef NEWTOY
10 #undef OLDTOY
11 #define NEWTOY(name, opts, flags) {#name, 0, opts, flags},
12 #define OLDTOY(name, oldname, opts, flags) {#name, 0, opts, flags}
13
14 // Populate toy_list[].
15
16 struct toy_list toy_list[] = {
17 #include "toys/toylist.h"
18 };
19
20 #define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list))
21
22 int main(int argc, char *argv[])
23 {
24 static char *toy_paths[]={"usr/","bin/","sbin/",0};
25 int i, len = 0;
26
27 // Output list of applets.
28 for (i=1; i<TOY_LIST_LEN; i++) {
29 int fl = toy_list[i].flags;
30 if (fl & TOYMASK_LOCATION) {
31 if (argc>1) {
32 int j;
33 for (j=0; toy_paths[j]; j++)
34 if (fl & (1<<j)) len += printf("%s", toy_paths[j]);
35 }
36 len += printf("%s\n",toy_list[i].name);
37 }
38 }
39 return 0;
40 }