dmc

dynamic mail client
git clone git://git.suckless.org/dmc
Log | Files | Refs | README | LICENSE

Makefile (1541B)


      1 include config.mk
      2 
      3 ifeq ($(HAVE_SSL),1)
      4 SSL_LIBS=`pkg-config libssl --libs`
      5 CFLAGS+=`pkg-config libssl --cflags`
      6 endif
      7 
      8 CFLAGS+=-DHAVE_SSL=${HAVE_SSL}
      9 CFLAGS+=-DVERSION=\"${VERSION}\"
     10 CFLAGS+=-DPREFIX=\"${PREFIX}\"
     11 pfx=${DESTDIR}/${PREFIX}
     12 
     13 BINS=dmc dmc-mbox dmc-smtp dmc-pop3 dmc-imap4 dmc-pack dmc-filter dmc-mbox
     14 
     15 all: config.h ${BINS}
     16 
     17 config.h:
     18 	cp config.def.h config.h
     19 
     20 dmc: dmc.o
     21 	${CC} dmc.o -o dmc
     22 
     23 dmc-smtp: smtp.o
     24 	${CC} ${LDFLAGS} smtp.o -o dmc-smtp -lresolv
     25 
     26 dmc-mbox: mbox.o
     27 	${CC} ${LDFLAGS} mbox.o -o dmc-mbox
     28 
     29 dmc-pack: pack.o
     30 	${CC} ${LDFLAGS} pack.o -o dmc-pack
     31 
     32 dmc-filter: filter.o
     33 	${CC} ${LDFLAGS} filter.o -o dmc-filter
     34 
     35 sock.tmp: sock.o
     36 	rm -f pop3.o imap4.o
     37 	@:> sock.tmp
     38 
     39 dmc-pop3: sock.tmp pop3.o
     40 	${CC} ${LDFLAGS} ${SSL_LIBS} pop3.o -o dmc-pop3
     41 
     42 dmc-imap4: sock.tmp imap4.o
     43 	${CC} ${LDFLAGS} ${SSL_LIBS} imap4.o -o dmc-imap4
     44 
     45 install:
     46 	chmod +x dmc dmc-tag dmc-mdir
     47 	mkdir -p ${pfx}/share/man/man1 ${pfx}/bin
     48 	cp -f dmc.1 ${pfx}/share/man/man1
     49 	cp -f dmc ${pfx}/bin
     50 	cp -f dmc.sh ${pfx}/bin
     51 	cp -f dmc-tag ${pfx}/bin
     52 	cp -f dmc-smtp ${pfx}/bin
     53 	cp -f dmc-pop3 ${pfx}/bin
     54 	cp -f dmc-imap4 ${pfx}/bin
     55 	cp -f dmc-pack ${pfx}/bin
     56 	cp -f dmc-filter ${pfx}/bin
     57 	cp -f dmc-mbox ${pfx}/bin
     58 	cp -f dmc-mdir ${pfx}/bin
     59 
     60 uninstall:
     61 	rm -f ${pfx}/bin/dmc
     62 	rm -f ${pfx}/bin/dmc-*
     63 	rm -f ${pfx}/share/man/man1/dmc.1
     64 
     65 clean:
     66 	rm -f ${BINS} *.o sock.tmp
     67 
     68 dist:
     69 	rm -rf dmc-${VERSION}
     70 	hg clone . dmc-${VERSION}
     71 	rm -rf dmc-${VERSION}/.hg
     72 	tar czvf dmc-${VERSION}.tar.gz dmc-${VERSION}
     73 	rm -rf dmc-${VERSION}
     74 
     75 loc:
     76 	sloccount .