To the best of my knowledge, George Lucas began and he and Alan Dean Foster working together wrote the opus that became the original Star Wars as about the 4th draft of the script, completing it in 1976 as both the script, and in an edited form, a novelization of the movie script, with the movie being released in 1977. While Lucas had originally contracted with Foster to write 2 novels as sequals to the original Star Wars (Star Wars - Episode IV, the first in the original trilogy, the middle 3 tales of the whole package Lucas envisioned) and that Lucas would then base the next 2 movies on those novels, that plan changed and only one novel was written by Foster for Lucas (it did not become a movie), and was published as "Splinter of the Mind's Eye" in 1978 or 1979. Between 1979 and 1983 there were two trilogies written that related adventures of Han Solo and Landro Calrissian, but again, nothing that became a movie. The real lanslide of books, comics and such began in the 1990s, and there was another explosion in the early 2000s which continues to this day. While all of these use characters that we are all familiar with, as well as some invented for the publications, in a which came first, the chicken or the egg review, it appears that each of the movies began as a script based on a master plan developed by George Lucas as the original move idea grew, developed and matured into what is now 6 movies, the original trilogy that is the middle period, the next trilogy that is the pre-quil to the original, and will eventually grow into three more movies with Disney's purchase of LucasFilms. All the written works form a rich Star Wars universe, but none of the (actually quite a large number) published novels, novellas or comics seems to be the specific basis for any Star Wars movie script, just great tales of the adventures of the original characters and lots of new ones.