1 # Visual C++ NMakefile for PDCurses library - Win32 VC++ 2.0+
3 # Usage: nmake -f [path\]vcwin32.mak [DEBUG=] [DLL=] [WIDE=] [UTF8=] [target]
5 # where target can be any of:
6 # [all|demos|pdcurses.lib|testcurs.exe...]
10 !ifndef PDCURSES_SRCDIR
14 !include $(PDCURSES_SRCDIR
)\version.mif
15 !include $(PDCURSES_SRCDIR
)\libobjs.mif
17 osdir
= $(PDCURSES_SRCDIR
)\win32
19 PDCURSES_WIN_H
= $(osdir
)\pdcwin.h
24 CFLAGS
= -Z7
-DPDCDEBUG
25 LDFLAGS
= -debug
-pdb
:none
31 BASEDEF
= $(PDCURSES_SRCDIR
)\exp-base.def
32 WIDEDEF
= $(PDCURSES_SRCDIR
)\exp-wide.def
38 DEFDEPS
= $(DEFDEPS
) $(WIDEDEF
)
42 UTF8OPT
= -DPDC_FORCE_UTF8
45 DEFFILE
= pdcurses.def
46 SHL_LD
= link
$(LDFLAGS
) /NOLOGO
/DLL
/OUT
:pdcurses.dll
/DEF
:$(DEFFILE
)
48 LINK
= link.exe
-nologo
50 CCLIBS
= user32.lib advapi32.lib
51 # may need to add msvcrt.lib for VC 2.x, VC 5.0 doesn't want it
52 #CCLIBS = msvcrt.lib user32.lib advapi32.lib
56 LIBCURSES
= pdcurses.lib
57 CURSESDLL
= pdcurses.dll
60 DLLOPT
= -DPDC_DLL_BUILD
61 PDCLIBS
= $(CURSESDLL
)
63 PDCLIBS
= $(LIBCURSES
)
66 BUILD
= $(CC
) -I
$(PDCURSES_SRCDIR
) -c
$(CFLAGS
) $(DLLOPT
) \
69 all: $(PDCLIBS
) $(DEMOS
)
80 DEMOOBJS
= $(DEMOS
:.exe
=.obj
) tui.obj
82 $(LIBOBJS
) $(PDCOBJS
) : $(PDCURSES_HEADERS
)
83 $(PDCOBJS
) : $(PDCURSES_WIN_H
)
84 $(DEMOOBJS
) : $(PDCURSES_CURSES_H
)
85 $(DEMOS
) : $(LIBCURSES
)
86 panel.obj
: $(PANEL_HEADER
)
87 terminfo.obj
: $(TERM_HEADER
)
90 $(LIBCURSES
) : $(LIBOBJS
) $(PDCOBJS
)
91 $(LIBEXE
) -out
:$@
$(LIBOBJS
) $(PDCOBJS
)
92 -copy
$(LIBCURSES
) panel.lib
95 $(DEFFILE
) : $(DEFDEPS
)
96 echo LIBRARY pdcurses
> $(DEFFILE
)
97 echo EXPORTS
>> $(DEFFILE
)
98 type
$(BASEDEF
) >> $(DEFFILE
)
100 type
$(WIDEDEF
) >> $(DEFFILE
)
103 $(CURSESDLL
) : $(LIBOBJS
) $(PDCOBJS
) $(DEFFILE
) pdcurses.obj
104 $(SHL_LD
) $(LIBOBJS
) $(PDCOBJS
) pdcurses.obj
$(CCLIBS
)
105 -copy
$(LIBCURSES
) panel.lib
107 pdcurses.res pdcurses.obj
: $(osdir
)\pdcurses.rc
$(osdir
)\pdcurses.ico
108 rc
/r
/fopdcurses.res
$(osdir
)\pdcurses.rc
109 cvtres
/MACHINE
:IX86
/NOLOGO
/OUT
:pdcurses.obj pdcurses.res
111 {$(srcdir)\
}.c
{}.obj
::
114 {$(osdir
)\
}.c
{}.obj
::
117 {$(demodir
)\
}.c
{}.obj
::
121 $(LINK
) $(LDFLAGS
) $< $(LIBCURSES
) $(CCLIBS
)
123 tuidemo.exe
: tuidemo.obj tui.obj
124 $(LINK
) $(LDFLAGS
) $*.obj tui.obj
$(LIBCURSES
) $(CCLIBS
)
126 tui.obj
: $(demodir
)\tui.c
$(demodir
)\tui.h
127 $(BUILD
) -I
$(demodir
) $(demodir
)\tui.c
129 tuidemo.obj
: $(demodir
)\tuidemo.c
130 $(BUILD
) -I
$(demodir
) $(demodir
)\tuidemo.c
132 PLATFORM1
= Visual C
++
133 PLATFORM2
= Microsoft Visual C
/C
++ for Win32
134 ARCNAME
= pdc
$(VER
)_vc_w32
136 !include $(PDCURSES_SRCDIR
)\makedist.mif