| 1 |
###################################################################### |
| 2 |
# birthday. Reminder of birthdays and other events in the near future. |
| 3 |
# $Id: Makefile,v 1.4 2005/09/02 19:33:18 andymort Exp $ |
| 4 |
|
| 5 |
OS=UNIX |
| 6 |
#OS=DOS |
| 7 |
|
| 8 |
# can override this on the commandline if req'd |
| 9 |
DEBUG= |
| 10 |
ifeq ($(OS),DOS) |
| 11 |
OSCFLAGS=-w |
| 12 |
else |
| 13 |
OSCFLAGS=-Wall -Wstrict-prototypes |
| 14 |
endif |
| •15 |
CFLAGS+=-O2 $(DEBUG) -D$(OS) $(OSCFLAGS) |
| 16 |
|
| 17 |
# engine |
| 18 |
ENGSRC=bdengine.c xmalloc.c |
| 19 |
|
| 20 |
# OS-specific sources |
| 21 |
ifeq ($(OS),DOS) |
| 22 |
OSSRC=alloca.c getopt.c |
| 23 |
else |
| 24 |
OSSRC= |
| 25 |
endif |
| 26 |
|
| 27 |
CMDSRC=birthday.c bdcal.c $(ENGSRC) $(OSSRC) |
| 28 |
WINSRC=winbd.c $(ENGSRC) $(OSSRC) |
| 29 |
|
| 30 |
ifeq ($(OS),DOS) |
| 31 |
CMDOBJ=$(CMDSRC:.c=.obj) |
| 32 |
WINOBJ=$(WINSRC:.c=.obj) bdwin.res |
| 33 |
else |
| 34 |
CMDOBJ=$(CMDSRC:.c=.o) |
| 35 |
#WINOBJ=$(WINSRC:.c=.o) |
| 36 |
endif |
| 37 |
|
| 38 |
ifeq ($(OS),DOS) |
| 39 |
birthday.exe: $(CMDOBJ) |
| 40 |
$(CC) $(LDFLAGS) $(CMDOBJ) -e $@ |
| 41 |
|
| 42 |
bdwin.res: bdwin.rc |
| 43 |
rc -r bdwin |
| 44 |
|
| 45 |
bdwin.exe: $(WINOBJ) |
| 46 |
$(CC) $(LDFLAGS) $(WINOBJ) -e $@ |
| 47 |
rc bdwin |
| 48 |
|
| 49 |
else |
| 50 |
birthday: $(CMDOBJ) |
| 51 |
$(CC) $(LDFLAGS) $(CMDOBJ) -o $@ |
| 52 |
|
| 53 |
# you can override this to use the new FHS locations. |
| 54 |
SHARE= |
| 55 |
#SHARE=/share |
| 56 |
|
| 57 |
install: birthday birthday.man |
| 58 |
install -d $(DESTDIR)/usr/bin $(DESTDIR)/usr$(SHARE)/man/man1 |
| •59 |
install birthday $(DESTDIR)/usr/bin/birthday |
| 60 |
install -m 0644 birthday.man $(DESTDIR)/usr$(SHARE)/man/man1/birthday.1 |
| 61 |
|
| 62 |
test: birthday |
| 63 |
sh runtest.sh -exec `pwd`/birthday test/*.t |
| 64 |
|
| 65 |
clean: |
| 66 |
rm -f birthday *.o |
| 67 |
|
| 68 |
VERSION := $(shell sed -ne '/^birthday/s/.*(\(.*\))/\1/gp' ChangeLog | head -1) |
| 69 |
dist: |
| 70 |
ln -s . birthday-$(VERSION) |
| 71 |
tar cf - `grep / CVS/Entries | cut -f2 -d/ | sed "s;^;birthday-$(VERSION)/;"` | bzip2 -c > birthday-$(VERSION).tar.bz2 |
| 72 |
rm birthday-$(VERSION) |
| 73 |
endif |
| 74 |
|
| 75 |
.PHONY: test |