diff options
author | Tobias Klauser <klto@zhaw.ch> | 2009-10-26 09:00:36 +0100 |
---|---|---|
committer | Tobias Klauser <klto@zhaw.ch> | 2009-10-26 09:00:36 +0100 |
commit | 68a702f97d226d16a14a8795fa228601bd0fd44a (patch) | |
tree | d89ebb9de91216f049a3f0cde7b46c708f793e8c /Makefile | |
parent | cd1ec1120f97557237b8f978de1aef7f399c8ef3 (diff) |
Rework Makfile, add install/uninstall targets
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -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) |