1 # Makefile for PDCurses library for SDL
9 include $(PDCURSES_SRCDIR
)/libobjs.mif
11 osdir
= $(PDCURSES_SRCDIR
)/sdl1
13 PDCURSES_SDL_H
= $(osdir
)/pdcsdl.h
15 SFLAGS
= $(shell sdl-config
--cflags)
16 SLIBS
= $(shell sdl-config
--libs
)
18 # If your system doesn't have these, remove the defines here
19 SFLAGS
+= -DHAVE_VSNPRINTF
-DHAVE_VSSCANF
22 CFLAGS
= -g
-Wall
-DPDCDEBUG
27 BUILD
= $(CC
) $(CFLAGS
) -I
$(PDCURSES_SRCDIR
)
29 ifeq ($(shell uname
),Darwin
)
30 DEMOFLAGS
= -Dmain
=SDL_main
34 LDFLAGS
= $(LIBCURSES
) $(SLIBS
)
36 LIBCURSES
= libpdcurses.a
38 DEMOS
= firework newdemo ptest rain testcurs tuidemo worm xmas \
41 .PHONY
: all libs
clean demos
48 -rm -rf
*.o trace
$(LIBCURSES
) $(DEMOS
)
53 $(LIBCURSES
) : $(LIBOBJS
) $(PDCOBJS
)
57 $(LIBOBJS
) $(PDCOBJS
) : $(PDCURSES_HEADERS
)
58 $(PDCOBJS
) : $(PDCURSES_SDL_H
)
59 $(DEMOS
) : $(PDCURSES_CURSES_H
) $(LIBCURSES
)
60 tui.o tuidemo.o
: $(PDCURSES_CURSES_H
)
61 terminfo.o
: $(TERM_HEADER
)
62 panel.o ptest
: $(PANEL_HEADER
)
64 $(LIBOBJS
) : %.o
: $(srcdir)/%.c
65 $(BUILD
) $(SFLAGS
) -c
$<
67 $(PDCOBJS
) : %.o
: $(osdir
)/%.c
68 $(BUILD
) $(SFLAGS
) -c
$<
70 firework
: $(demodir
)/firework.c
71 $(BUILD
) $(DEMOFLAGS
) -o
$@
$< $(LDFLAGS
)
73 newdemo
: $(demodir
)/newdemo.c
74 $(BUILD
) $(DEMOFLAGS
) -o
$@
$< $(LDFLAGS
)
76 ptest
: $(demodir
)/ptest.c
77 $(BUILD
) $(DEMOFLAGS
) -o
$@
$< $(LDFLAGS
)
79 rain
: $(demodir
)/rain.c
80 $(BUILD
) $(DEMOFLAGS
) -o
$@
$< $(LDFLAGS
)
82 testcurs
: $(demodir
)/testcurs.c
83 $(BUILD
) $(DEMOFLAGS
) -o
$@
$< $(LDFLAGS
)
85 tuidemo
: tuidemo.o tui.o
86 $(LINK
) tui.o tuidemo.o
-o
$@
$(LDFLAGS
)
88 worm
: $(demodir
)/worm.c
89 $(BUILD
) $(DEMOFLAGS
) -o
$@
$< $(LDFLAGS
)
91 xmas
: $(demodir
)/xmas.c
92 $(BUILD
) $(DEMOFLAGS
) -o
$@
$< $(LDFLAGS
)
94 sdltest
: $(osdir
)/sdltest.c
95 $(BUILD
) $(DEMOFLAGS
) -o
$@
$< $(LDFLAGS
)
97 tui.o
: $(demodir
)/tui.c
$(demodir
)/tui.h
98 $(BUILD
) -c
$(DEMOFLAGS
) $(demodir
)/tui.c
100 tuidemo.o
: $(demodir
)/tuidemo.c
101 $(BUILD
) -c
$(DEMOFLAGS
) $(demodir
)/tuidemo.c