#This is a make file. It will make our program for us by connecting the main #program to the libraries/headers, and then cleaning up unwanted files. #Define what target we want to make by default default: example #Define a variable LIBOBJECTS which will have a list of objects to #include in the library libmylibrary.a LIBOBJECTS=2_Quarks.o #Create library libmylibrary.a libmylibrary.a : $(LIBOBJECTS) ar cru libmylibrary.a $(LIBOBJECTS) #Define an external library EXTLIB=/pathToPythia/pythia8205/lib/libpythia8.a #Define a link to pythia8 include directory INCLUDE=-I/pathToPythia/pythia8205/include #Create 2_Quarks.o from 2_Quarks.cc and 2_Quarks.h and include Pythia path 2_Quarks.o : 2_Quarks.cc 2_Quarks.h g++ $(INCLUDE) -c 2_Quarks.cc #Make the example program example : example.cc libmylibrary.a $(EXTLIB) g++ $(INCLUDE) example.cc -o example libmylibrary.a $(EXTLIB) #Clean up everything clean : rm -f example ./*.o ./*.a #to run this type make