if (!KjcOptions.magic_net && !KjcOptions.decoupled)
if (!(KjcOptions.magic_net || KjcOptions.decoupled || IMEMEstimation.TESTING_IMEM))
    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()));	    }	    //remove joiners from the hashset if we are in decoupled mode, 	    //we do not want to simulate joiners	    if (KjcOptions.decoupled) 		removeJoiners(tiles);	    Iterator tilesIterator = tiles.iterator();	    	    fw.write("#-*-Makefile-*-\n\n");	    /*	    if (KjcOptions.outputs < 0 &&		! (KjcOptions.numbers > 0))		fw.write("LIMIT = TRUE\n"); // need to define limit for SIMCYCLES to matter	    */	    //            fw.write("ATTRIBUTES = IMEM_EXTRA_LARGE\n");	    if (!IMEMEstimation.TESTING_IMEM) {		fw.write("BTL-DEVICES += -dram_freq 100\n");		fw.write("ATTRIBUTES += HWIC\n");		//add some other stuff		fw.write("MEMORY_LAYOUT=LEFT_RIGHT_SIDES\n");		fw.write("BTL-DEVICES += -enable_all_sides_for_dram -dram lhs\n");	    }	    	    //if we are generating number gathering code, 	    //we do not want to use the default print service...	    if (KjcOptions.outputs > 0 ||		KjcOptions.numbers > 0 ||		KjcOptions.decoupled) {		fw.write("EXTRA_BTL_ARGS += -magic_instruction\n ");	    }	    else {		fw.write("ATTRIBUTES += USES_PRINT_SERVICE\n");	    }	    	    //fw.write("SIM-CYCLES = 500000\n\n");	    fw.write("\n");	    //if we are using the magic network, tell btl	    if (KjcOptions.magic_net)		fw.write("EXTRA_BTL_ARGS += " +			 "-magic_instruction -magic_crossbar C1H1\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, tiles);            else                createBCFile(false, tiles);	    if (RawBackend.rawRows > 4) {		fw.write("TILE_PATTERN = 8x8\n\n");	    }	    //fix for snake boot race condition	    fw.write("MULTI_SNAKEBOOT = 0\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 ");		//if we are using the magic net, we do not create 		//the switch assembly files, same if we are running decoupledxx		if (!KjcOptions.magic_net && !KjcOptions.decoupled) 		    fw.write("sw" + tile + ".o");		fw.write("\n");	    }	    	    //use sam's gcc and set the parameters of the tile	    if (KjcOptions.altcodegen) {		fw.write		    ("\nRGCC=/home/pkg/brave_new_linux/0225.btl.rawlib.starbuild/install/slgcc/bin/raw-gcc\n");		fw.write("\nDMEM_PORTS  = 1\n");		fw.write("ISSUE_WIDTH = 1\n\n");		fw.write("EXTRA_BTL_ARGS += -issue_width $(ISSUE_WIDTH) -dmem_ports $(DMEM_PORTS)\n");		fw.write("RGCCFLAGS += -missue_width=$(ISSUE_WIDTH) -mdmem_ports=$(DMEM_PORTS)\n");	    }	    fw.write("\ninclude $(COMMONDIR)/Makefile.all\n\n");	    fw.write("clean:\n");	    fw.write("\trm -f *.o\n");	    fw.write("\trm -f tile*.s\n\n");	    fw.close();	}	catch (Exception e) 	    {		System.err.println("Error writing Makefile");		e.printStackTrace();	    }    }