it was really broken (from muller@nprdc.arpa)
[unix-history] / usr / src / lib / libcurses / Makefile
index 0081b5b..0c498a3 100644 (file)
@@ -1,24 +1,32 @@
-#      Makefile        1.17    83/07/02
+#
+# Copyright (c) 1980 Regents of the University of California.
+# All rights reserved.  The Berkeley software License Agreement
+# specifies the terms and conditions for redistribution.
+#
+#      @(#)Makefile    5.1 (Berkeley) %G%
 #
 # curses package
 #
 #
 # curses package
 #
-CFILES=        box.c clear.c initscr.c endwin.c mvprintw.c mvscanw.c mvwin.c \
-       newwin.c overlay.c overwrite.c printw.c scanw.c refresh.c \
-       touchwin.c erase.c clrtobot.c clrtoeol.c cr_put.c cr_tty.c \
-       longname.c delwin.c insertln.c deleteln.c scroll.c getstr.c \
-       getch.c addstr.c addch.c move.c curses.c unctrl.c standout.c \
-       tstp.c insch.c delch.c
+CFILES=        addch.c addstr.c box.c clear.c clrtobot.c clrtoeol.c cr_put.c \
+       cr_tty.c curses.c delch.c deleteln.c delwin.c endwin.c erase.c \
+       fullname.c getch.c getstr.c idlok.c id_subwins.c initscr.c insch.c \
+       insertln.c longname.c move.c mvprintw.c mvscanw.c mvwin.c newwin.c \
+       overlay.c overwrite.c printw.c putchar.c refresh.c scanw.c scroll.c \
+       toucholap.c standout.c touchwin.c tstp.c unctrl.c
 OBJS=  addch.o addstr.o box.o clear.o clrtobot.o clrtoeol.o cr_put.o \
        cr_tty.o curses.o delch.o deleteln.o delwin.o endwin.o erase.o \
 OBJS=  addch.o addstr.o box.o clear.o clrtobot.o clrtoeol.o cr_put.o \
        cr_tty.o curses.o delch.o deleteln.o delwin.o endwin.o erase.o \
-       getch.o getstr.o initscr.o insch.o insertln.o longname.o move.o \
-       mvprintw.o mvscanw.o mvwin.o newwin.o overlay.o overwrite.o \
-       printw.o refresh.o scanw.o scroll.o standout.o touchwin.o tstp.o \
-       unctrl.o
+       fullname.o getch.o getstr.o idlok.o id_subwins.o initscr.o insch.o \
+       insertln.o longname.o move.o mvprintw.o mvscanw.o mvwin.o newwin.o \
+       overlay.o overwrite.o printw.o putchar.o refresh.o scanw.o scroll.o \
+       toucholap.o standout.o touchwin.o tstp.o unctrl.o
+
 CTAGS= ctags
 CTAGS= ctags
-CFLAGS=        -O
+DEFS=
+CFLAGS=        -O $(DEFS)
+TAGSFILE=tags
 
 .c.o:
 
 .c.o:
-       ${CC} -c -p ${CFLAGS} $*.c
+       ${CC} -c -pg ${CFLAGS} $*.c
        ld -x -r $*.o
        mv a.out profiled/$*.o
        ${CC} -c ${CFLAGS} $*.c
        ld -x -r $*.o
        mv a.out profiled/$*.o
        ${CC} -c ${CFLAGS} $*.c
@@ -27,9 +35,11 @@ CFLAGS=      -O
 
 libcurses libcurses_p: ${OBJS}
        @echo building profiled libcurses
 
 libcurses libcurses_p: ${OBJS}
        @echo building profiled libcurses
-       @cd profiled; ar cr ../libcurses_p ${OBJS}
+       @cd profiled; ar cu ../libcurses_p ${OBJS}
+       ranlib libcurses_p
        @echo building normal libcurses
        @echo building normal libcurses
-       @ar cr libcurses ${OBJS}
+       @ar cu libcurses ${OBJS}
+       ranlib libcurses
 
 install: libcurses libcurses_p
        install -m 644 libcurses ${DESTDIR}/usr/lib/libcurses.a
 
 install: libcurses libcurses_p
        install -m 644 libcurses ${DESTDIR}/usr/lib/libcurses.a
@@ -37,8 +47,15 @@ install: libcurses libcurses_p
        install -m 644 libcurses_p ${DESTDIR}/usr/lib/libcurses_p.a
        ranlib ${DESTDIR}/usr/lib/libcurses_p.a
 
        install -m 644 libcurses_p ${DESTDIR}/usr/lib/libcurses_p.a
        ranlib ${DESTDIR}/usr/lib/libcurses_p.a
 
+tags:
+       cwd=`pwd`; \
+       for i in ${CFILES}; do \
+               ctags -a -f ${TAGSFILE} $$cwd/$$i; \
+       done
+
 clean:
 clean:
-       rm -f ${OBJS} profiled/*.o a.out core test errs libcurses libcurses_p
+       rm -f ${OBJS} profiled/*.o a.out core test errs \
+           libcurses libcurses_p tags
 
 ctags:
        ${CTAGS} ${CFILES} curses.h
 
 ctags:
        ${CTAGS} ${CFILES} curses.h
@@ -47,7 +64,10 @@ lint:
        lint -hxb ${CFILES} -lcurses > lint.out
 
 test:  libcurses test.o
        lint -hxb ${CFILES} -lcurses > lint.out
 
 test:  libcurses test.o
-       ${CC} ${LDFLAGS} ${CFLAGS} -o test test.o crlib -ltermlib
+       ${CC} ${LDFLAGS} ${CFLAGS} -o test test.o libcurses -ltermlib
+
+test.o:        test.c
+       ${CC} ${CFLAGS} -c test.c
 
 
-cat.o: curses.h
-       ${CC} -c ${CFLAGS} cat.c
+ar:
+       ar crv curses.ar ${CFILES} curses.h curses.ext Makefile