Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. # Makefile for PDCurses for SDL
  2.  
  3. O = o
  4.  
  5. ifndef PDCURSES_SRCDIR
  6.         PDCURSES_SRCDIR = ..
  7. endif
  8.  
  9. include $(PDCURSES_SRCDIR)/common/libobjs.mif
  10.  
  11. osdir           = $(PDCURSES_SRCDIR)/sdl1
  12.  
  13. PDCURSES_SDL_H  = $(osdir)/pdcsdl.h
  14.  
  15.  
  16. ifeq ($(DEBUG),Y)
  17.         CFLAGS  = -g -Wall -DPDCDEBUG -fPIC
  18. else
  19.         CFLAGS  = -O2 -Wall -fPIC
  20. endif
  21.  
  22. ifeq ($(WIDE),Y)
  23.         CFLAGS  += -DPDC_WIDE
  24.         SLIBS   += -lSDL_ttf
  25. endif
  26.  
  27. ifeq ($(UTF8),Y)
  28.         CFLAGS  += -DPDC_FORCE_UTF8
  29. endif
  30.  
  31. BUILD           = $(CC) $(CFLAGS) -I$(PDCURSES_SRCDIR)
  32.  
  33. LINK            = $(CC)
  34. LDFLAGS         = $(LIBCURSES) $(SLIBS)
  35. RANLIB          = ranlib
  36. LIBCURSES       = pdcurses.a
  37.  
  38. DEMOS           += sdltest
  39.  
  40. .PHONY: all libs clean demos
  41.  
  42. all:    libs
  43.  
  44. libs:   $(LIBCURSES)
  45.  
  46. clean:
  47.         -rm -rf *.o trace $(LIBCURSES) $(DEMOS)
  48.  
  49. demos:  $(DEMOS)
  50. ifneq ($(DEBUG),Y)
  51.         strip $(DEMOS)
  52. endif
  53.  
  54. $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
  55.         ar rv $@ $?
  56.         -$(RANLIB) $@
  57.  
  58. $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
  59. $(PDCOBJS) : $(PDCURSES_SDL_H)
  60. $(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
  61. tui.o tuidemo.o : $(PDCURSES_CURSES_H)
  62. panel.o ptest: $(PANEL_HEADER)
  63.  
  64. $(LIBOBJS) : %.o: $(srcdir)/%.c
  65.         $(BUILD) -c $<
  66.  
  67. $(PDCOBJS) : %.o: $(osdir)/%.c
  68.         $(BUILD) $(SFLAGS) -c $<
  69.  
  70. firework: $(demodir)/firework.c
  71.         $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
  72.  
  73. ozdemo: $(demodir)/ozdemo.c
  74.         $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
  75.  
  76. ptest: $(demodir)/ptest.c
  77.         $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
  78.  
  79. rain: $(demodir)/rain.c
  80.         $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
  81.  
  82. testcurs: $(demodir)/testcurs.c
  83.         $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
  84.  
  85. tuidemo: tuidemo.o tui.o
  86.         $(LINK) tui.o tuidemo.o -o $@ $(LDFLAGS)
  87.  
  88. worm: $(demodir)/worm.c
  89.         $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
  90.  
  91. xmas: $(demodir)/xmas.c
  92.         $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)
  93.  
  94. sdltest: $(osdir)/sdltest.c
  95.         $(BUILD) $(DEMOFLAGS) $(SFLAGS) -o $@ $< $(LDFLAGS)
  96.  
  97. tui.o: $(demodir)/tui.c $(demodir)/tui.h
  98.         $(BUILD) -c $(DEMOFLAGS) $(demodir)/tui.c
  99.  
  100. tuidemo.o: $(demodir)/tuidemo.c
  101.         $(BUILD) -c $(DEMOFLAGS) $(demodir)/tuidemo.c
  102.  
  103. include $(demodir)/nctests.mif
  104.