From 107036348dcb3d4f4a754b4d2010cec83d257ab6 Mon Sep 17 00:00:00 2001 From: alecs Date: Fri, 14 May 2021 19:42:06 +0200 Subject: [PATCH 1/2] Added make clean --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 013ee1c..a9d13ac 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ all: as -o $(FILE).o $(FILE).s ld -o $(FILE) $(FILE).o +clean: + rm $(FILE).o + rm $(FILE) + debug: as -g -o $(FILE).o $(FILE).s ld -o $(FILE) $(FILE).o From 7253af98ec1a0f4f2ba26b2ac129ad085cd34592 Mon Sep 17 00:00:00 2001 From: alecs Date: Fri, 14 May 2021 20:13:39 +0200 Subject: [PATCH 2/2] Added support to install and uninstall figa --- Makefile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a9d13ac..49aff48 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,22 @@ +PREFIX ?= /usr FILE = figa all: - as -o $(FILE).o $(FILE).s - ld -o $(FILE) $(FILE).o + @as -o $(FILE).o $(FILE).s + @ld -o $(FILE) $(FILE).o clean: - rm $(FILE).o - rm $(FILE) + @rm $(FILE).o + @rm $(FILE) + +install: + @mkdir -p $(DESTDIR)$(PREFIX)/bin + @cp -p figa $(DESTDIR)$(PREFIX)/bin/figa + +uninstall: + @rm $(DESTDIR)$(PREFIX)/bin/figa debug: - as -g -o $(FILE).o $(FILE).s - ld -o $(FILE) $(FILE).o + @as -g -o $(FILE).o $(FILE).s + @ld -o $(FILE) $(FILE).o