I have two listings which are my Makefile sources. Some lines in this Makefiles are long. I need to fit them side by side in a particular location in my report. I tried to do something like this but I was not successful.
\documentclass[12pt, a4paper, titlepage]{scrartcl}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\graphicspath{{./Figures/}}
\usepackage{url}
%\usepackage{titlesec}
%\newcommand{\sectionbreak}{\clearpage}
\usepackage{dirtree}
\usepackage{color}
\usepackage{listings}
\usepackage{caption}
%to get clickable links from table of contents
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
\newcommand{\courierword}[1]{\textsf{\itshape #1}}{\fontfamily{pcr}\selectfont}%
\setlength{\parindent}{0.0cm}
\setlength{\parskip}{1ex}
\setkomafont{sectioning}{\normalcolor\bfseries}
The actual content is as below
\begin{figure}[!ht]
\begin{minipage}{.5\textwidth}
\captionof{figure}{Makefile for 'aocs' Collection}
\lstset{language=make,
commentstyle=\color{red},
breaklines=true,
}
\begin{lstlisting}[frame=single][t]
This section contains my Makefile 2
Some lines are really toooooooooooooooooooooooooooooooooo long
\end{lstlisting}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\captionof{figure}{Makefile for 'aocsApFw' Constituent}
\lstset{language=make,
commentstyle=\color{red},
breaklines=true,
}
\begin{lstlisting}[frame=single][t]
This section contains my Makefile 2
Some lines are really toooooooooooooooooooooooooooooooooo long
\end{lstlisting}
\end{minipage}
\end{figure}