From: W. Trevor King Date: Mon, 11 Feb 2013 15:01:46 +0000 (-0500) Subject: Rename C programs and update the Makefile X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5e1cf04eac0894a9bc603da1e47190a0d931b8cb;p=assignment-template.git Rename C programs and update the Makefile --- diff --git a/.gitignore b/.gitignore index 3723be1..830e366 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -hello_world -goodbye_world +one_gaussian_bump +error_analysis *.o diff --git a/Makefile b/Makefile index af2d15b..97c4ac9 100644 --- a/Makefile +++ b/Makefile @@ -19,19 +19,19 @@ # http://www.gnu.org/software/make/manual/html_node/Reference.html # You can override variables from the command line. For example # $ make VERSION=2 dist -# will generate phys405-hw0-2.tar.gz -COURSE = phys405 -PACKAGE = hw0 +# will generate phys305-hw4-2.tar.gz +COURSE = phys305 +PACKAGE = hw4 VERSION = 1 RELEASE = $(COURSE)-$(PACKAGE)-$(VERSION) -RUN_PROGRAM = hello_world +RUN_PROGRAM = SCRIPTS = -C_PROGRAMS = hello_world -CXX_PROGRAMS = goodbye_world +C_PROGRAMS = one_gaussian_bump error_analysis +CXX_PROGRAMS = PROGRAMS = $(C_PROGRAMS) $(CXX_PROGRAMS) # Define the source files that will be distributed in the tarball -SOURCE = *.c *.cpp *.h COPYING Makefile README $(SCRIPTS) +SOURCE = *.c *.h COPYING Makefile README $(SCRIPTS) # Define a list of object files needed to link PROGRAM. We're setting # things up here so that a program % depends on the object file %.o. @@ -46,7 +46,7 @@ $(foreach PROGRAM, $(PROGRAMS), $(eval $(PROGRAM)_OBJECTS = $(PROGRAM).o)) # You may want to link agains external libraries. For example, to # link against the system math library, use. # hello_world_LIBS = -lm -$(foreach PROGRAM, $(PROGRAMS), $(eval $(PROGRAM)_LIBS =)) +$(foreach PROGRAM, $(PROGRAMS), $(eval $(PROGRAM)_LIBS = -lm)) # Define useful programs (this makes it easy to swap in alternates) CP = cp diff --git a/hello_world.c b/error_analysis.c similarity index 100% rename from hello_world.c rename to error_analysis.c diff --git a/goodbye_world.cpp b/one_gaussian_bump.c similarity index 86% rename from goodbye_world.cpp rename to one_gaussian_bump.c index f9ec77f..c242304 100644 --- a/goodbye_world.cpp +++ b/one_gaussian_bump.c @@ -1,5 +1,5 @@ /* -A simple "hello world" example in C++. +A simple "hello world" example in C. Copyright (C) 2012 W. Trevor King @@ -17,11 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include - -using namespace std; +#include int main() { - cout << "goodbye, world\n"; + printf("hello, world\n"); return 0; }