int Fibonancci::produce_output(int number){
    if (number < 2){
        return number;
    }else{
        return (produce_output(number-1)+produce_output(number-2));
    } 
}
Exemplo n.º 2
0
int
main (int argc, char *argv[])
{
  int i;
  char tmp[256], *env;

  struct stat st;

  if (getenv("USE_PHPMAKE") != NULL)
  if (stat("phpmake/library.php", &st) != -1)
     config_phpmake=1;

  for (i = 1; i < argc; i++)
    if (argv[i][0] == '-')
      switch (argv[i][1])
	{
	case 'A':
	  strcpy (arch, &argv[i][2]);
	  printf ("Arch=%s\n", arch);
	  break;
	case 'K':
	  kernelonly = 1;
	  break;		/* Compile only the kernel mode parts */
	case 'U':
	  useronly = 1;
	  break;		/* Compile only the user land utilities */
	}

  if (getenv("NO_WARNING_CHECKS")!=NULL)
     do_warning_checks = 0;

  hostcc = getenv ("HOSTCC");
  targetcc = getenv ("CC");
  if (hostcc == NULL) hostcc = DEFAULT_CC;
  if (targetcc == NULL) targetcc = DEFAULT_CC;

#if defined(linux) || defined(__FreeBSD__) || defined(__SCO_VERSION__)
  mkdir ("target", 0755);
  mkdir ("target/build", 0755);
  system ("touch target/build/.nomake");
#endif

  if (getenv ("SOL9") != NULL)
    system ("touch kernel/drv/oss_usb/.nomake");

  check_system (&conf);

/*
 * Check if setup/$CROSSCOMPILE.conf exists and load the settings in it.
 */
  if ((env=getenv("CROSSCOMPILE"))!=NULL)
     {
	     FILE *cf;

	     sprintf (tmp, "setup/%s.conf", env);
  	     if ((cf = fopen (tmp, "r")) != NULL)
    		{
      	     		parse_config (cf, &conf, tmp);
			fclose (cf);
     		}
     }
  

  produce_output (&conf);

  produce_errno_h();
  exit (0);
}