libpayload: Add PDCurses and ncurses' libform/libmenu
[coreboot.git] / payloads / libpayload / curses / PDCurses-3.4 / dos / gccdos.mak
1 # GNU MAKE (3.79.1) Makefile for PDCurses library - DOS DJGPP V2.0+
2 #
3 # Usage: make -f [path\]gccdos.mak [DEBUG=Y] [target]
4 #
5 # where target can be any of:
6 # [all|libs|demos|dist|pdcurses.a|testcurs.exe...]
7
8 O = o
9
10 ifndef PDCURSES_SRCDIR
11         PDCURSES_SRCDIR = ..
12 endif
13
14 include $(PDCURSES_SRCDIR)/version.mif
15 include $(PDCURSES_SRCDIR)/libobjs.mif
16
17 osdir           = $(PDCURSES_SRCDIR)/dos
18
19 PDCURSES_DOS_H  = $(osdir)/pdcdos.h
20
21 CC              = gcc
22
23 ifeq ($(DEBUG),Y)
24         CFLAGS  = -g -Wall -DPDCDEBUG
25         LDFLAGS = -g
26 else
27         CFLAGS  = -O2 -Wall
28         LDFLAGS =
29 endif
30
31 CFLAGS += -I$(PDCURSES_SRCDIR)
32
33 LINK            = gcc
34
35 LIBEXE          = ar
36 LIBFLAGS        = rcv
37
38 LIBCURSES       = pdcurses.a
39
40 .PHONY: all libs clean demos dist
41
42 all:    libs demos
43
44 libs:   $(LIBCURSES)
45
46 clean:
47         -del *.o
48         -del *.a
49         -del *.exe
50
51 demos:  $(DEMOS)
52         strip *.exe
53
54 $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
55         $(LIBEXE) $(LIBFLAGS) $@ $?
56         -copy $(LIBCURSES) panel.a
57
58 $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
59 $(PDCOBJS) : $(PDCURSES_DOS_H)
60 $(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
61 panel.o : $(PANEL_HEADER)
62 terminfo.o: $(TERM_HEADER)
63
64 $(LIBOBJS) : %.o: $(srcdir)/%.c
65         $(CC) -c $(CFLAGS) $<
66
67 $(PDCOBJS) : %.o: $(osdir)/%.c
68         $(CC) -c $(CFLAGS) $<
69
70 firework.exe newdemo.exe rain.exe testcurs.exe worm.exe xmas.exe \
71 ptest.exe: %.exe: $(demodir)/%.c
72         $(CC) $(CFLAGS) -o$@ $< $(LIBCURSES)
73
74 tuidemo.exe: tuidemo.o tui.o
75         $(LINK) $(LDFLAGS) -o$@ tuidemo.o tui.o $(LIBCURSES)
76
77 tui.o: $(demodir)/tui.c $(demodir)/tui.h $(PDCURSES_CURSES_H)
78         $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $<
79
80 tuidemo.o: $(demodir)/tuidemo.c $(PDCURSES_CURSES_H)
81         $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $<
82
83 PLATFORM1 = DJGPP 2.03
84 PLATFORM2 = DJGPP 2.03 for DOS
85 ARCNAME = pdc$(VER)djg
86
87 include $(PDCURSES_SRCDIR)/makedist.mif