"tile" + tile + ".o " + "sw" + tile + ".o\n");
"tile" + tile + ".o ");   if (!KjcOptions.magic_net) fw.write("sw" + tile + ".o"); fw.write("\n");
    public static void createMakefile()     {	try {	    //FileWriter fw = new FileWriter("Makefile");	    FileWriter fw = new FileWriter(MAKEFILE_NAME);	    //create a set of all the tiles with code	    HashSet tiles = new HashSet();	    tiles.addAll(TileCode.realTiles);	    tiles.addAll(TileCode.tiles);	    	    //remove the tiles assigned to FileReaders	    //do not generate switchcode for Tiles assigned to file readers	    //they are just dummy tiles	    Iterator frs = FileVisitor.fileNodes.iterator();	    while (frs.hasNext()) {		tiles.remove(Layout.getTile((FlatNode)frs.next()));	    }	    Iterator tilesIterator = tiles.iterator();	    	    fw.write("#-*-Makefile-*-\n\n");	    fw.write("LIMIT = TRUE\n"); // need to define limit for SIMCYCLES to matter            fw.write("ATTRIBUTES = IMEM_LARGE\n");	    //if we are generating number gathering code, 	    //we do not want to use the default print service...	    if (KjcOptions.numbers > 0 && NumberGathering.successful)		fw.write("ATTRIBUTES += NO_PRINT_SERVICE\n");	    fw.write("SIM-CYCLES = 500000\n\n");	    fw.write("include $(TOPDIR)/Makefile.include\n\n");	    fw.write("RGCCFLAGS += -O3\n\n");            fw.write("BTL-MACHINE-FILE = fileio.bc\n\n");	    if (FileVisitor.foundReader || FileVisitor.foundWriter)		createBCFile(true);            else                createBCFile(false);	    if (RawBackend.rawRows > 4)		fw.write("TILE_PATTERN=8x8\n\n");	    fw.write("TILES = ");	    while (tilesIterator.hasNext()) {		int tile = 		    Layout.getTileNumber((Coordinate)tilesIterator.next());				if (tile < 10)		    fw.write("0" + tile + " ");		else 		    fw.write(tile + " ");	    }	    	    fw.write("\n\n");	    	    tilesIterator = tiles.iterator();	    while(tilesIterator.hasNext()) {		int tile = 		    Layout.getTileNumber((Coordinate)tilesIterator.next());				if (tile < 10) 		    fw.write("OBJECT_FILES_0");		else		    fw.write("OBJECT_FILES_");		fw.write(tile + " = " +			 "tile" + tile + ".o " +			 "sw" + tile + ".o\n");	    }	    	    fw.write("\ninclude $(COMMONDIR)/Makefile.all\n\n");	    fw.write("clean:\n");	    fw.write("\trm -f *.o\n\n");	    if(KjcOptions.sketchycodegen) {		fw.write("%.s:  %.c\n");		fw.write("\t$(RGCC) $(RGCCFLAGS) $(INCLUDES) $(DEFS) -S $< -o $@\n");		fw.write("\tgrep -v router_mem $@ > $@.new\n");		fw.write("\tmv $@.new $@");	    }	    fw.close();	}	catch (Exception e) 	    {		System.err.println("Error writing Makefile");		e.printStackTrace();	    }    }