From 68a702f97d226d16a14a8795fa228601bd0fd44a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 26 Oct 2009 09:00:36 +0100 Subject: Rework Makfile, add install/uninstall targets --- Makefile | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'Makefile') 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) -- cgit v1.2.3-54-g00ecf