1# Generic Makefile for hpucode 2 3ifeq ($(DEBIAN), 1) 4# Every Debian-Source-Paket has one included. 5include /usr/share/husky/huskymak.cfg 6else 7include ../huskymak.cfg 8endif 9 10 11ifeq ($(DEBUG), 1) 12 CFLAGS = -I$(INCDIR) -I.$(DIRSEP)h $(DEBCFLAGS) $(WARNFLAGS) 13 LFLAGS = $(DEBLFLAGS) 14else 15 CFLAGS = -I$(INCDIR) -I.$(DIRSEP)h $(OPTCFLAGS) $(WARNFLAGS) 16 LFLAGS = $(OPTLFLAGS) 17endif 18 19ifeq ($(SHORTNAME), 1) 20 LIBS=-L$(LIBDIR) -lfidoconf -lsmapi -lhusky 21else 22 LIBS=-L$(LIBDIR) -lfidoconfig -lsmapi -lhusky 23endif 24 25CDEFS = -D$(OSTYPE) $(ADDCDEFS) 26 27CFLAGS += -Wall -pedantic -Wno-char-subscripts 28 29OBJS = uuecode.o uuefile.o scanmsg.o dupe.o 30 31SRC_DIR = .$(DIRSEP)src$(DIRSEP) 32 33 34hpucode: $(OBJS) 35 gcc $(OBJS) $(LFLAGS) $(LIBS) -o hpucode$(_EXE) 36 37%.o: $(SRC_DIR)%.c 38 $(CC) $(CFLAGS) $(CDEFS) -c $< 39 40hpucode.1.gz: man/hpucode.1 41 gzip -9c man/hpucode.1 > hpucode.1.gz 42 43clean: 44 -$(RM) $(RMOPT) *$(_OBJ) 45 -$(RM) $(RMOPT) *~ 46 47distclean: clean 48 -$(RM) $(RMOPT) hpucode$(_EXE) 49 -$(RM) $(RMOPT) hpucode.info 50 -$(RM) $(RMOPT) hpucode.html 51 -$(RM) $(RMOPT) hpucode.1.gz 52 53info: 54 makeinfo --no-split hpucode.texi 55 56html: 57 makeinfo --html --no-split hpucode.texi 58 59docs: info html 60 61ifdef INFODIR 62 all: hpucode info hpucode.1.gz 63ifdef HTMLDIR 64 all: hpucode docs hpucode.1.gz 65endif 66else 67ifdef HTMLDIR 68 all: hpucode html hpucode.1.gz 69else 70 all: hpucode hpucode.1.gz 71endif 72endif 73 74install: all 75 $(INSTALL) $(IBOPT) hpucode$(_EXE) $(DESTDIR)$(BINDIR) 76ifdef INFODIR 77 -$(MKDIR) $(MKDIROPT) $(DESTDIR)$(INFODIR) 78 $(INSTALL) $(IMOPT) hpucode.info $(DESTDIR)$(INFODIR) 79 -install-info --info-dir=$(INFODIR) $(DESTDIR)$(INFODIR)$(DIRSEP)hpucode.info 80endif 81ifdef HTMLDIR 82 -$(MKDIR) $(MKDIROPT) $(DESTDIR)$(HTMLDIR) 83 $(INSTALL) $(IMOPT) hpucode.html $(DESTDIR)$(HTMLDIR) 84endif 85ifdef MANDIR 86 -$(MKDIR) $(MKDIROPT) $(DESTDIR)$(MANDIR)$(DIRSEP)man1 87 $(INSTALL) $(IMOPT) hpucode.1.gz $(DESTDIR)$(MANDIR)$(DIRSEP)man1 88endif 89 90uninstall: 91 $(RM) $(RMOPT) $(BINDIR)$(DIRSEP)hpucode$(_EXE) 92ifdef INFODIR 93 $(RM) $(RMOPT) $(INFODIR)$(DIRSEP)hpucode.info 94endif 95ifdef HTMLDIR 96 $(RM) $(RMOPT) $(HTMLDIR)$(DIRSEP)hpucode.html 97endif 98ifdef MANDIR 99 $(RM) $(RMOPT) $(MANDIR)$(DIRSEP)man1$(DIRSEP)hpucode.1.gz 100endif 101