home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / infidx13.zip / infidx.mak < prev    next >
Makefile  |  1993-07-01  |  2KB  |  68 lines

  1. # OS/2-NMAKE makefile for INFIDX
  2. #
  3. # uses IBM C/C++ Set/2
  4. #
  5.  
  6. # compiler & flags
  7. CC=icc
  8. CFLAGS=-Wcnd -Wcnv -Wdcl -Weff -Wenu -Word -Wpar -Wpro -Wrea -Wret -Wtrd -Wund -Wuse -Ti -DIBMCPP
  9.  
  10. # linker & flags (I use the compiler driver here too)
  11. LINK=$(CC)
  12. LINKFLAGS=$(CFLAGS)
  13.  
  14. # assumptions
  15. # .SUFFIXES is right
  16. # environment variable INCLUDE holds all dirs with the include files
  17. # environment variable LIB     holds all dirs with the lib     files
  18.  
  19. # basename of the main programm without any suffix
  20. PRG=infidx
  21.  
  22. # as there is only one C-source-file all other names are made by substituions
  23. SOURCE=$(PRG).c
  24. OBJECTS=$(SOURCE:.c=.obj)
  25. RESOURCE=$(PRG).res
  26. HEADER=$(PRG).h
  27. ICONFILE=$(PRG).ico
  28. MODULDEF=$(PRG).def
  29. MAKEFILE=$(PRG).mak
  30.  
  31.  
  32.  
  33. # rule to compile a c-module in an object file
  34. .c.obj:
  35.         $(CC) $(CFLAGS) -c $<
  36.  
  37. # rule to compile a resource-script in a binary resource file
  38. .rc.res:
  39.         rc -r $<
  40.  
  41. # default target (build the program)
  42. all: $(PRG)
  43.  
  44. # remove all make results but the executable file
  45. clean:
  46.         - del $(OBJECTS) $(RESOURCE) $(PRG)
  47.  
  48. # remove all make results including the executable file
  49. rasa: CLEAN
  50.         - del $(PRG).exe 
  51.  
  52. # dependencies
  53.  
  54. $(OBJECTS): $(SOURCE) $(HEADER) $(MAKEFILE)
  55.  
  56. $(RESOURCE): $(RESOURCE:.res=.rc) $(HEADER) $(ICONFILE) $(MAKEFILE)
  57.  
  58.  
  59. # link objects and lib to .exe
  60. $(PRG).exe: $(OBJECTS)
  61.         $(LINK) $(LINKFLAGS) $(OBJECTS) $(LIBS) $(MODULDEF)
  62.  
  63. # .exe + .res -> .exe and mark-file
  64. $(PRG): $(PRG).exe $(RESOURCE) $(MODULDEF)
  65.         rc $(PRG).res $(PRG).exe
  66.         touch $(PRG)
  67.  
  68.