From 6445aa388546b288cbc8c271c9204b3719a708f5 Mon Sep 17 00:00:00 2001 From: Benjamin Althues Date: Tue, 22 May 2012 22:06:50 +0200 Subject: [PATCH 1/2] Add install and clean commands to Makefile Install to /usr/local/bin by default and prepare Makefile for linking several different source files. --- src/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index b9611a0..a57930f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,2 +1,12 @@ -baps1: main.c - $(CC) -Wall -Wextra -lm main.c -o baps1 +CC = cc -Wall -Wextra +INST_PATH = /usr/local/bin + +baps1: main.o + $(CC) -o baps1 main.o -lm + +main.o: main.c + $(CC) -c main.c +install: + cp baps1 $(INST_PATH)/baps1 +clean: + rm baps1 *.o From 9948d8eaa8e70d9580b567d7e1ffb9904248d978 Mon Sep 17 00:00:00 2001 From: Benjamin Althues Date: Sun, 27 May 2012 21:34:40 +0200 Subject: [PATCH 2/2] Make baps1 a dependency for the install target --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index a57930f..25056d4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -6,7 +6,7 @@ baps1: main.o main.o: main.c $(CC) -c main.c -install: +install: baps1 cp baps1 $(INST_PATH)/baps1 clean: rm baps1 *.o