| |
| CC := gcc |
| #CC := gcc-4.3.2-gld |
| INSTALL ?= install |
| |
| CFLAGS += -I include |
| CFLAGS += -std=gnu99 -Wall -Wno-unused-value -Os |
| #CFLAGS += -D DEBUG=1 |
| |
| #CFLAGS += -D HAEV_LIBDEVINFO=1 |
| #LIBS += -l devinfo |
| |
| PREFIX ?= /usr/local |
| SBINDIR ?= $(PREFIX)/sbin |
| DATADIR ?= $(PREFIX)/share |
| MANDIR ?= $(DATADIR)/man |
| |
| PROG := mfiutil |
| MANPAGE := mfiutil.8 |
| |
| SRCS:= mfiutil.c mfi_bbu.c mfi_cmd.c mfi_config.c mfi_drive.c mfi_evt.c \ |
| mfi_flash.c mfi_patrol.c mfi_show.c mfi_volume.c mfi_foreign.c \ |
| mfi_properties.c human_readable.c |
| |
| OBJECTS = $(addsuffix .o,$(basename $(SRCS))) ${SRCS:R:S/$/.o/g} |
| |
| default: $(PROG) |
| |
| $(PROG): $(OBJECTS) |
| $(CC) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBS) |
| |
| clean: |
| rm -f $(OBJECTS) $(PROG) |
| |
| install: $(PROG) $(MANPAGE) |
| [ -d "$(DESTDIR)$(SBINDIR)" ] || mkdir -p "$(DESTDIR)$(SBINDIR)" |
| [ -d "$(DESTDIR)$(MANDIR)/man8" ] || mkdir -p "$(DESTDIR)$(MANDIR)/man8" |
| $(INSTALL) -m 755 $(PROG) "$(DESTDIR)$(SBINDIR)/" |
| $(INSTALL) -m 644 $(MANPAGE) "$(DESTDIR)$(MANDIR)/man8/" |