home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 1999 March / PCShareware-3-99.iso / IMPLE / DJGPP.RAR / DJGPP2 / XLIB-SR0.ZIP / SRC / XLIBEMU / MAKEFILE < prev    next >
Text File  |  1994-09-05  |  5KB  |  162 lines

  1. # Makefile for Xlibemu, an Xlib emulation based on GRX
  2. # $Id: makefile 1.6 1994/02/11 00:43:44 ulrich Exp ulrich $
  3.  
  4. .NOEXPORT:
  5.  
  6. # Directory for unmodified sources
  7. MITLIBX_DIR    = /xlib/src/x11/mit/lib/x
  8. # GRX installation directory
  9. GRXDIR    = /djgpp/contrib/libgrx
  10. # GRX font dir
  11. FNTDIR    = $(GRXDIR)/allfonts
  12. # Directory for include <X11/...>
  13. INCDIR    = /xlib/include
  14. # Directory for installing libX11.a
  15. LIBDIR    = /xlib/lib
  16.  
  17. # Where to find sources
  18. vpath %.c $(MITLIBX_DIR)
  19.  
  20. # Sources
  21. EMULIBSRC    = \
  22.     atom.c     backgnd.c  bdrwidt.c  bell.c     border.c   chcmap.c \
  23.     chkeycon.c chsavese.c chwattr.c  chwindo.c  cirwin.c   cirwind.c \
  24.     cirwinu.c  clear.c    clearar.c  color.c    confwin.c  copyarea.c \
  25.     copyplan.c crwindo.c  cursfnt.c  cursor.c   debug.c    defcurs.c \
  26.     destsub.c  destwin.c  dispatch.c draw.c     drawtext.c error.c \
  27.     event.c    eventque.c font.c     gc.c       getgeom.c  getifocu.c \
  28.     getkcnt.c  getpntma.c getwatt.c  globals.c  grabkeyb.c internal.c \
  29.     loadkeym.c lowerwi.c  maprais.c  mapsubs.c  mapwind.c  misc.c \
  30.     modmap.c   movewin.c  opendisp.c pixmap.c   pmapbgn.c  pmapbor.c \
  31.     pointer.c  property.c putimage.c qutree.c   raisewi.c  reconfw.c \
  32.     repwind.c  selectio.c selinpu.c  sendeven.c setcrect.c setdash.c \
  33.     setifocu.c setlocal.c todo.c     trcoord.c  undefcu.c  unldfont.c \
  34.     unmapsu.c  unmapwi.c  window.c   winint.c   xrminitp.c \
  35.     gethostn.c console.c  xreadsen.c
  36.  
  37. # Unmodified sources from X11R5 distribution
  38. # (actually from export.lcs.mit.edu:/pub/R5untarred/mit/lib/X/*)
  39. MITLIBSRC    = \
  40.     xparsege.c xdisname.c xmacros.c  xregion.c \
  41.     xstname.c  xsethint.c xgethint.c xfetchna.c \
  42.     getnrmhi.c getwmcma.c getwmpro.c getrgbcm.c \
  43.     gettxtpr.c settxtpr.c texttost.c \
  44.     setwmpro.c setwmprp.c setwmcma.c xsetclma.c xsetstip.c \
  45.     xnexteve.c xputbeve.c xpeekeve.c xpeekife.c xpending.c \
  46.     xifevent.c xfiltere.c xgetdflt.c xerrdes.c  context.c  strtotex.c \
  47.     propallo.c setnrmhi.c xchkwine.c xsettsor.c xrdbitf.c  iconify.c \
  48.     xwineven.c xchkifev.c xgetfpro.c evtomask.c xmaskeve.c xchkmask.c \
  49.     xchktypw.c xchktype.c xstbytes.c xerrhndl.c ximutil.c  xkeybind.c \
  50.     xstrkeys.c xkeysyms.c xscrress.c xautorep.c xgeom.c    xmisc.c \
  51.     xchgc.c    xsetlsty.c xsetfont.c xgcmisc.c  xsetback.c xsetfore.c \
  52.     xsettile.c xsetpmas.c xsetfunc.c getgcval.c depths.c   wmgeom.c \
  53.     xinitext.c xfswrap.c  xlcwrap.c  xvisutil.c withdraw.c \
  54.     quarks.c   xrm.c      parsecmd.c xrminitp.c
  55.  
  56. X11LIBSRC    = $(EMULIBSRC) $(MITLIBSRC)
  57. X11LIBOBJ    = $(X11LIBSRC:.c=.o)
  58. X11LIB        = libX11.a
  59.  
  60. X11LIBOBJ_P    = $(addprefix prof/,$(X11LIBOBJ))
  61. X11LIB_P    = libX11_p.a
  62.  
  63. TESTSRC = debug.c hello.c makemodm.c
  64. TESTOBJ = $(TESTSRC:.c=.o)
  65.  
  66. ALLSRCS    = $(X11LIBSRC) $(TESTSRC)
  67.  
  68. # LIBS    = -lfvwm -L. -lX11 -L$(GRXDIR)/lib -lgrx -lpc
  69. LIBS    = -L$(LIBDIR) -lfvwm -lX11 -L$(GRXDIR)/lib -lgrx -lpc
  70.  
  71. # Misc
  72. AWK    = gawk
  73. RUN    = go32
  74. MODMAP    = xmodmap.gr
  75. INSTALL    = cp -uv
  76. LONARGS    = ar:cp:
  77.  
  78. # Compiler options
  79. CC    = gcc
  80. CFLAGS    = -W -O2 -m486 -DGRX $(CFLAGS_DEBUG) \
  81.     -I. -I$(MITLIBX_DIR) -I- -I$(GRXDIR)/include -I$(INCDIR)
  82. CFLAGS_DEBUG = # -DDEBUG # -g
  83.  
  84. # Rules
  85. %.o : %.c
  86.     $(CC) $(CFLAGS) -o $@ -c $<
  87. %.s : %.c
  88.     $(CC) $(CFLAGS) -S -o $@ -c $<
  89.  
  90. prof/%.o : %.c
  91.     $(CC) -pg $(CFLAGS) -o $@ -c $<
  92.  
  93. # Targets
  94.  
  95. default: $(X11LIB) hello cursor.fnt
  96.  
  97. .PHONY: install
  98. install: $(X11LIB) xfonts.dir
  99.     $(INSTALL) $(X11LIB) $(LIBDIR)/$(X11LIB)
  100.     $(INSTALL) xfonts.dir $(FNTDIR)
  101.  
  102. $(X11LIB): $(X11LIBOBJ)
  103.     ar rv $@ $?
  104.     ranlib $@
  105.  
  106. $(X11LIB_P): $(X11LIBOBJ_P)
  107.     ar rv $@ $?
  108.     ranlib $@
  109.  
  110. ks_tables.h: util/makekeys.c
  111.     $(CC) -o makekeys $<
  112.     $(RUN) makekeys < $(X11INC)/X11/keysymdef.h > ks_table.tmp
  113.     mv -f ks_table.tmp $@
  114.     rm -f makekeys ks_table.tmp
  115.  
  116. modmap.h: $(MODMAP) makemodm.c
  117.     $(CC) -o makemodm makemodm.c
  118.     $(RUN) makemodm < $< > $@
  119.     rm -f makemodm
  120.  
  121. rgb.h: rgb.txt rgb.awk
  122.     $(AWK) -f rgb.awk rgb.txt > $@
  123.  
  124. hello: hello.o debug.o # $(X11LIB)
  125.     $(CC) $(CFLAGS) -o $@ hello.o debug.o $(LIBS)
  126.  
  127. console: console.c $(X11LIB)
  128.     $(CC) -g -DTEST $(CFLAGS) -o $@ $^ $(LIBS)
  129.  
  130. term: term.c $(X11LIB)
  131.     $(CC) $(CFLAGS) -DTEST -o $@ $^ $(LIBS)
  132.  
  133. cursor.fnt: cursfnt
  134.     $(RUN) cursfnt
  135.  
  136. cursfnt: cursfnt.c cursor.h
  137.     $(CC) $(CFLAGS) -o $@ $<  -L$(GRXDIR)/lib -lgrx
  138.  
  139. xfonts.dir: makxfdir
  140.     $(RUN) makxfdir -o $@ $(FNTDIR)/*.fnt
  141.  
  142. makxfdir: makxfdir.c
  143.     $(CC) $(CFLAGS) -o $@ $<
  144.  
  145. .PHONY: depend
  146. depend: $(ALLSRCS)
  147.     $(CC) $(CFLAGS) -MM $^ > makefile.dep
  148.  
  149. .PHONY: clean
  150. clean:
  151.     rm -f *.o cursfnt term makxfdir
  152.  
  153. .PHONY: clobber
  154. clobber: clean
  155.     rm -f *.a hello cursor.fnt modmap.h rgb.h xfonts.dir
  156.  
  157. # Source dependencies
  158.  
  159. ifneq ($(wildcard makefile.dep),)
  160. include makefile.dep
  161. endif
  162.