Makefile revision 80d2660fa95615f3bc77a9b258414f2c533175c
180d2660fa95615f3bc77a9b258414f2c533175cGoffredo BaroncelliCC = gcc
280d2660fa95615f3bc77a9b258414f2c533175cGoffredo BaroncelliAM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
380d2660fa95615f3bc77a9b258414f2c533175cGoffredo BaroncelliCFLAGS = -g -O0
480d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliobjects = mmc.o
580d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
680d2660fa95615f3bc77a9b258414f2c533175cGoffredo BaroncelliCHECKFLAGS= -Wall -Werror -Wuninitialized -Wundef
780d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
880d2660fa95615f3bc77a9b258414f2c533175cGoffredo BaroncelliDEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
980d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
1080d2660fa95615f3bc77a9b258414f2c533175cGoffredo BaroncelliINSTALL = install
1180d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliprefix ?= /usr/local
1280d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncellibindir = $(prefix)/bin
1380d2660fa95615f3bc77a9b258414f2c533175cGoffredo BaroncelliLIBS=
1480d2660fa95615f3bc77a9b258414f2c533175cGoffredo BaroncelliRESTORE_LIBS=
1580d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
1680d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliprogs = mmc
1780d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
1880d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli# make C=1 to enable sparse
1980d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliifdef C
2080d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	check = sparse $(CHECKFLAGS)
2180d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliendif
2280d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
2380d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliall: $(progs) manpages
2480d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
2580d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli.c.o:
2680d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliifdef C
2780d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	$(check) $<
2880d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliendif
2980d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	$(CC) $(CHECKFLAGS) $(AM_CFLAGS) $(DEPFLAGS) $(CFLAGS) -c $<
3080d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
3180d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncellimmc: $(objects)
3280d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	$(CC) $(CFLAGS) -o $@ $(objects) $(LDFLAGS) $(LIBS)
3380d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
3480d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncellimanpages:
3580d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	cd man && make
3680d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
3780d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliinstall-man:
3880d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	cd man && make install
3980d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
4080d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliclean:
4180d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	rm -f $(progs) $(objects)
4280d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	cd man && make clean
4380d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli
4480d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelliinstall: $(progs) install-man
4580d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	$(INSTALL) -m755 -d $(DESTDIR)$(bindir)
4680d2660fa95615f3bc77a9b258414f2c533175cGoffredo Baroncelli	$(INSTALL) $(progs) $(DESTDIR)$(bindir)
47