Apply the make magic wand to pick an osdep-*.c file rather than using ifdefs.

This commit is contained in:
Nicholas Marriott
2009-04-29 23:07:35 +00:00
parent ce989a91d1
commit 91241f1457
8 changed files with 16 additions and 38 deletions

View File

@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.88 2009-04-29 22:42:02 nicm Exp $
# $Id: GNUmakefile,v 1.89 2009-04-29 23:07:35 nicm Exp $
.PHONY: clean
@ -42,9 +42,7 @@ SRCS= tmux.c server.c server-msg.c server-fn.c buffer.c buffer-poll.c status.c \
window-clock.c window-scroll.c window-more.c window-copy.c \
window-choose.c \
options.c options-cmd.c paste.c colour.c utf8.c clock.c \
tty.c tty-term.c tty-keys.c tty-write.c util.c names.c \
osdep-unknown.c osdep-openbsd.c osdep-freebsd.c osdep-linux.c \
osdep-darwin.c attributes.c
tty.c tty-term.c tty-keys.c tty-write.c util.c names.c attributes.c
CC?= gcc
INCDIRS+= -I. -I-
@ -120,6 +118,10 @@ CFLAGS+= $(shell getconf LFS_CFLAGS) -D_GNU_SOURCE \
LIBS+= -lcrypt -lutil
endif
LCOS= $(shell uname|tr '[:upper:]' '[:lower:]')
OSDEP= $(shell [ -f osdep-$(LCOS).c ] && echo $(LCOS) || echo unknown)
SRCS+= osdep-$(OSDEP).c
OBJS= $(patsubst %.c,%.o,$(SRCS))
CLEANFILES= ${PROG} *.o .depend *~ ${PROG}.core *.log compat/*.o index.html