1 # GNU MAKE Makefile for PDCurses library - WIN32 MinGW GCC
3 # Usage: make -f [path\]mingwin32.mak [DEBUG=Y] [DLL=Y] [WIDE=Y] [UTF8=Y] [tgt]
5 # where tgt can be any of:
6 # [all|demos|pdcurses.a|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
= -g
-Wall
-DPDCDEBUG
31 CFLAGS
+= -I
$(PDCURSES_SRCDIR
)
33 BASEDEF
= $(PDCURSES_SRCDIR
)\exp-base.def
34 WIDEDEF
= $(PDCURSES_SRCDIR
)\exp-wide.def
44 CFLAGS
+= -DPDC_FORCE_UTF8
47 DEFFILE
= pdcurses.def
52 CFLAGS
+= -DPDC_DLL_BUILD
53 LIBEXE
= gcc
$(DEFFILE
)
54 LIBFLAGS
= -Wl
,--out-implib
,pdcurses.a
-shared
-o
55 LIBCURSES
= pdcurses.dll
56 LIBDEPS
= $(LIBOBJS
) $(PDCOBJS
) $(DEFFILE
)
57 CLEAN
= $(LIBCURSES
) *.a
$(DEFFILE
)
61 LIBCURSES
= pdcurses.a
62 LIBDEPS
= $(LIBOBJS
) $(PDCOBJS
)
66 .PHONY
: all libs
clean demos
dist
80 $(DEFFILE
): $(DEFDEPS
)
81 echo LIBRARY pdcurses
> $@
88 $(LIBCURSES
) : $(LIBDEPS
)
89 $(LIBEXE
) $(LIBFLAGS
) $@
$?
90 -copy pdcurses.a panel.a
92 $(LIBOBJS
) $(PDCOBJS
) : $(PDCURSES_HEADERS
)
93 $(PDCOBJS
) : $(PDCURSES_WIN_H
)
94 $(DEMOS
) : $(PDCURSES_CURSES_H
) $(LIBCURSES
)
95 panel.o
: $(PANEL_HEADER
)
96 terminfo.o
: $(TERM_HEADER
)
98 $(LIBOBJS
) : %.o
: $(srcdir)/%.c
101 $(PDCOBJS
) : %.o
: $(osdir
)/%.c
102 $(CC
) -c
$(CFLAGS
) $<
104 firework.exe newdemo.exe rain.exe testcurs.exe worm.exe xmas.exe \
105 ptest.exe
: %.exe
: $(demodir
)/%.c
106 $(CC
) $(CFLAGS
) -o
$@
$< $(LIBCURSES
)
108 tuidemo.exe
: tuidemo.o tui.o
109 $(LINK
) $(LDFLAGS
) -o
$@ tuidemo.o tui.o
$(LIBCURSES
)
111 tui.o
: $(demodir
)/tui.c
$(demodir
)/tui.h
$(PDCURSES_CURSES_H
)
112 $(CC
) -c
$(CFLAGS
) -I
$(demodir
) -o
$@
$<
114 tuidemo.o
: $(demodir
)/tuidemo.c
$(PDCURSES_CURSES_H
)
115 $(CC
) -c
$(CFLAGS
) -I
$(demodir
) -o
$@
$<
117 PLATFORM1
= MinGW Win32
118 PLATFORM2
= MinGW for Win32
119 ARCNAME
= pdc
$(VER
)_ming_w32
121 include $(PDCURSES_SRCDIR
)/makedist.mif