home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / spmio10.zip / gcc2 / stdwin / Makefile < prev    next >
Makefile  |  1994-09-18  |  2KB  |  87 lines

  1. CC=gcc
  2. CFLAGS=-Wall -I. -DNDEBUG -O9
  3. LIBMODULES = stdwin stdframe framectl stdfont
  4. MODULES = $(LIBMODULES) test1 test2 test3
  5. HEADERS = stdwin stdframe framectl stdfont
  6. LIBDIR_BASE = /gcc2/lib
  7. LIBDIR_STATIC = $(LIBDIR_BASE)/static
  8. LIBDIR_DYNAMIC = $(LIBDIR_BASE)/dynamic
  9. DLLDIR = /gcc2/dll
  10. INCDIR = /gcc2/gccincl
  11.  
  12. LIBOBJS = $(addsuffix .obj, $(LIBMODULES)
  13. DLLOBJ = $(addprefix $(LIBDIR_BASE)/, dllinit0.obj dllinit.obj) $(LIBOBJS)
  14. OBJS = $(addsuffix .obj, $(MODULES))
  15. SOURCE = $(addsuffix .cc, $(MODULES))
  16. DEPS = $(addsuffix .d, $(MODULES))
  17. HFILES = $(addsuffix .h, $(HEADERS))
  18. DESTHFILES = $(addprefix $(INCDIR)/, $(HFILES))
  19.  
  20. %.obj %.d: %.cc
  21.     $(CC) $(CFLAGS) -c -MD $<
  22. $(INCDIR)/%.h: %.h
  23.     rm -f $@
  24.     cp $< $@
  25.  
  26. .PHONY: all clean depend default install tests
  27.  
  28. default: all
  29. all: stdwin.lib stdwinx.lib
  30.  
  31. install: $(LIBDIR_STATIC)/stdwin.lib \
  32.     $(LIBDIR_DYNAMIC)/stdwin.lib \
  33.     $(DLLDIR)/stdwin.dll \
  34.     $(DESTHFILES)
  35.  
  36. $(LIBDIR_STATIC)/stdwin.lib: stdwinx.lib
  37.     rm -f $(LIBDIR_STATIC)/stdwin.lib
  38.     cp stdwinx.lib $(LIBDIR_STATIC)/stdwin.lib
  39. $(LIBDIR_DYNAMIC)/stdwin.lib: stdwin.lib
  40.     rm -f $(LIBDIR_DYNAMIC)/stdwin.lib
  41.     cp stdwin.lib $(LIBDIR_DYNAMIC)/stdwin.lib
  42. $(DLLDIR)/stdwin.dll: stdwin.dll
  43.     rm -f $(DLLDIR)/stdwin.dll
  44.     cp stdwin.dll $(DLLDIR)
  45. $(DESTHFILES):
  46.  
  47.  
  48. tests: test1.exe test1x.exe test2.exe test2x.exe test3.exe test3x.exe
  49.  
  50. test1.exe: stdwin.lib test1.obj
  51.     $(CC) -o test1.exe test1.obj stdwin.lib  -Xlinker -pm
  52. test1x.exe: stdwinx.lib test1.obj
  53.     $(CC) -o test1x.exe test1.obj stdwinx.lib -Xlinker -pm
  54.  
  55. test2.exe: stdwin.lib test2.obj
  56.     $(CC) -o test2.exe test2.obj stdwin.lib -Xlinker -pm
  57. test2x.exe: stdwinx.lib test2.obj
  58.     $(CC) -o test2x.exe test2.obj stdwinx.lib -Xlinker -pm
  59.  
  60. test3.exe: stdwin.lib test3.obj
  61.     $(CC) -o test3.exe test3.obj stdwin.lib -Xlinker -pm
  62. test3x.exe: stdwin.lib test3.obj
  63.     $(CC) -o test3x.exe test3.obj stdwinx.lib -Xlinker -pm
  64.  
  65. stdwinx.lib: $(LIBOBJS)
  66.     rm -f stdwinx.lib
  67.     glib stdwinx.lib $(addprefix -a , $(LIBOBJS))
  68.  
  69. stdwin.lib: stdwin.def stdwin.dll
  70.     implib /NOI /NOL stdwin.lib stdwin.def
  71. stdwin.dll: $(DLLOBJ) stdwin.def
  72.     gcc -o stdwin.dll stdwin.def $(DLLOBJ)
  73.  
  74. stdwin.def: stdwin.de0 $(DLLOBJ)
  75.     omfexp $(DLLOBJ) | gnusort -u | cat stdwin.de0 - > stdwin.def
  76.     
  77.  
  78. clean:
  79.     rm -f $(OBJS) *~ stdwin.lib stdwinx.lib stdwin.dll stdwin.def
  80.  
  81. depend: $(DEPS) $(OBJS)
  82.     cat $(DEPS) > depend.mak
  83.  
  84. $(OBJS) $(DEPS):
  85.  
  86. include depend.mak
  87.