  We consider the asymmetric exclusion process (ASEP) in one dimension on sites
$i = 1,..., N$, in contact at sites $i=1$ and $i=N$ with infinite particle
reservoirs at densities $\rho_a$ and $\rho_b$. As $\rho_a$ and $\rho_b$ are
varied, the typical macroscopic steady state density profile $\bar \rho(x)$,
$x\in[a,b]$, obtained in the limit $N=L(b-a)\to\infty$, exhibits shocks and
phase transitions. Here we derive an exact asymptotic expression for the
probability of observing an arbitrary macroscopic profile $\rho(x)$:
$P_N(\{\rho(x)\})\sim\exp[-L{\cal F}_{[a,b]}(\{\rho(x)\});\rho_a,\rho_b]$, so
that ${\cal F}$ is the large deviation functional, a quantity similar to the
free energy of equilibrium systems. We find, as in the symmetric, purely
diffusive case $q=1$ (treated in an earlier work), that $\cal F$ is in general
a non-local functional of $\rho(x)$. Unlike the symmetric case, however, the
asymmetric case exhibits ranges of the parameters for which ${\cal
F}(\{\rho(x)\})$ is not convex and others for which ${\cal F}(\{\rho(x)\})$ has
discontinuities in its second derivatives at $\rho(x) = \bar{\rho}(x)$; the
fluctuations near $\bar{\rho}(x)$ are then non-Gaussian and cannot be
calculated from the large deviation function.
