mirror of
https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git
synced 2024-11-23 18:03:29 +08:00
6117755361
Most useful when cross-compiling. Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Signed-off-by: Chris Ball <cjb@laptop.org>
49 lines
840 B
Makefile
49 lines
840 B
Makefile
CC ?= gcc
|
|
AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
|
|
CFLAGS ?= -g -O2
|
|
objects = mmc.o mmc_cmds.o
|
|
|
|
CHECKFLAGS = -Wall -Werror -Wuninitialized -Wundef
|
|
|
|
DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
|
|
|
|
override CFLAGS := $(CHECKFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
|
|
|
INSTALL = install
|
|
prefix ?= /usr/local
|
|
bindir = $(prefix)/bin
|
|
LIBS=
|
|
RESTORE_LIBS=
|
|
|
|
progs = mmc
|
|
|
|
# make C=1 to enable sparse
|
|
ifdef C
|
|
check = sparse $(CHECKFLAGS)
|
|
endif
|
|
|
|
all: $(progs) manpages
|
|
|
|
.c.o:
|
|
ifdef C
|
|
$(check) $<
|
|
endif
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) -c $<
|
|
|
|
mmc: $(objects)
|
|
$(CC) $(CFLAGS) -o $@ $(objects) $(LDFLAGS) $(LIBS)
|
|
|
|
manpages:
|
|
cd man && make
|
|
|
|
install-man:
|
|
cd man && make install
|
|
|
|
clean:
|
|
rm -f $(progs) $(objects)
|
|
cd man && make clean
|
|
|
|
install: $(progs) install-man
|
|
$(INSTALL) -m755 -d $(DESTDIR)$(bindir)
|
|
$(INSTALL) $(progs) $(DESTDIR)$(bindir)
|