bch
/
xmem
1
0
Fork 0

Summary: improved installation, make dist target

This commit is contained in:
bch 2017-03-15 20:26:03 +00:00
parent fbedd2a351
commit 53ca874f25
1 changed files with 30 additions and 21 deletions

View File

@ -1,29 +1,38 @@
CFLAGS += -Wall -I/usr/X11R6/include/
BINDIR=/usr/local/bin
MANDIR=/usr/local/man/man1
LDFLAGS=-L/usr/X11R6/lib -lX11 -lXt -lXaw -lXmu
PROG= xmem
VERSION= 1.26
LDFLAGS+= -L/usr/X11R6/lib -lX11 -lXt -lXaw -lXmu
CFLAGS+= -Wall -I/usr/X11R6/include/
OBJECTS= xmem.o get_mem.o MemStripChart.o
xmem: xmem.o get_mem.o MemStripChart.o
$(CC) -o xmem xmem.o get_mem.o MemStripChart.o $(LDFLAGS)
xmem: $(OBJECTS)
$(CC) -o xmem $(OBJECTS) $(LDFLAGS)
xmem.o: xmem.c
$(CC) $(CFLAGS) -c xmem.c
%.o: %c
$(CC) $(CFLAGS) -c $<
get_mem.o: get_mem.c
$(CC) $(CFLAGS) -c get_mem.c
clean:
-rm -rf $(OBJECTS) $(PROG)
MemStripChart.o: MemStripChart.c
$(CC) $(CFLAGS) -c MemStripChart.c
dist:
mkdir -p ${PROG}-${VERSION}
cp *.h *.c Makefile xmem.1 xmem.bit copyright XMem.ad ${PROG}-${VERSION}
tar cfvz ${PROG}-${VERSION}.tar.gz ${PROG}-${VERSION}
rm -rf ${PROG}-${VERSION}
clean:
-rm xmem *.o *~
dist-clean:
-rm ${PROG}-${VERSION}.tar.gz
install:
install -d -m 755 {PREFIX}/bin/
install -c -S -s -o root -g bin -m 755 xmem ${PREFIX}/bin/xmem
install -d -m 755 ${PREFIX}/man/man1/
install -c -o root -g bin -m 644 xmem.1 ${PREFIX}/man/man1/xmem.1
install -d -m 755 ${PREFIX}/lib/X11/app-defaults/
install -c -o root -g bin -m 644 XMem.ad ${PREFIX}/lib/X11/app-defaults/XMem
install -d -m 755 ${PREFIX}/share/${PROG}/
install -c -o root -g bin -m 644 xmem.bit ${PREFIX}/share/${PROG}/xmem.bit
install -c -o root -g bin -m 644 copyright ${PREFIX}/share/${PROG}/copyright
all: xmem
install: all
/usr/bin/install -c -m 0555 xmem $(DESTDIR)$(BINDIR)
/usr/bin/install -c -m 0444 xmem.0 $(DESTDIR)$(MANDIR)
/usr/bin/install -c -m 0644 XMem.ad $(DESTDIR)/usr/local/lib/X11/app-defaults/XMem
/usr/bin/install -d -m 0755 $(DESTDIR)/usr/local/share/xmem/
/usr/bin/install -c -m 0644 xmem.bit $(DESTDIR)/usr/local/share/xmem/
/usr/bin/install -c -m 0644 copyright $(DESTDIR)/usr/local/share/xmem/
.include <bsd.prog.mk>