summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <klto@zhaw.ch>2009-10-26 09:00:36 +0100
committerTobias Klauser <klto@zhaw.ch>2009-10-26 09:00:36 +0100
commit68a702f97d226d16a14a8795fa228601bd0fd44a (patch)
treed89ebb9de91216f049a3f0cde7b46c708f793e8c
parentcd1ec1120f97557237b8f978de1aef7f399c8ef3 (diff)
Rework Makfile, add install/uninstall targets
-rw-r--r--Makefile26
1 files changed, 18 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 9c2bd53..a0cbf46 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,16 @@
+prefix = $(HOME)
-MKUBOOTENV = mkubootenv
-MKUBOOTENV_OBJS = mkubootenv.o crc32.o
+P = mkubootenv
+OBJS = mkubootenv.o crc32.o
+WHERE = $(prefix)/bin/$(P)
-CFLAGS += -W -Wall -Wextra -Wstrict-prototypes -Wsign-compare -Wshadow \
- -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
- -Wpointer-arith -Wcast-align
+CFLAGS += -W -Wall -Wextra -Wstrict-prototypes -Wsign-compare -Wshadow \
+ -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
+ -Wpointer-arith -Wcast-align
-all: $(MKUBOOTENV)
+all: $(P)
-$(MKUBOOTENV): $(MKUBOOTENV_OBJS)
+$(P): $(OBJS)
@echo " LD $@"
@$(CC) $(LDFLAGS) -o $@ $^
@@ -20,6 +22,14 @@ $(MKUBOOTENV): $(MKUBOOTENV_OBJS)
@echo " CC $@"
@$(CC) $(CFLAGS) -c $< -o $@
+install:
+ @echo " INSTALL $(WHERE)"
+ @install -m755 -D $(P) $(WHERE)
+
+uninstall:
+ @echo " UNINSTALL $(WHERE)"
+ @rm -f $(WHERE)
+
clean:
@echo " CLEAN"
- @rm -f *.o $(MKUBOOTENV)
+ @rm -f $(OBJS) $(P)