home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / dev / misc / adoc / source / makefile < prev    next >
Makefile  |  1995-04-13  |  2KB  |  85 lines

  1. # ADOC -*- Makefile -*- for the GNU C/C++ Compiler on unix systems
  2. #
  3. # (c)Copyright 1995 by Tobias Ferber.
  4. #
  5. # This file is part of ADOC.
  6. #
  7. # ADOC is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published
  9. # by the Free Software Foundation; either version 1 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # ADOC is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with ADOC; see the file COPYING.  If not, write to
  19. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. CC= gcc
  22. CFLAGS= -O3
  23. #CFLAGS= -ggdb -Wall -DDEBUG
  24.  
  25. RM= rm -f
  26.  
  27. srcs = main.c args.c lex.yy.c libfun.c gencode.c strarg.c strexpand.c mactab.c flist.c
  28. #srcs = main.c args.c lex.yy.c libfun.c gencode.c strarg.c strexpand.c mactab.c flist.c debug.c smartmem.c timer.c
  29. objs = $(srcs:.c=.o)
  30. libs = -lfl
  31. prog = adoc
  32.  
  33.  
  34. .PHONY: all
  35.  
  36. all: $(prog) coda
  37.  
  38. $(prog): $(objs)
  39.     $(CC) $(CFLAGS) -o $@ $(objs) $(libs)
  40.  
  41. lex.yy.c: adoc.yy
  42.     flex -8 -f adoc.yy
  43.  
  44. .c.o:
  45.     $(CC) $(CFLAGS) -c -o $@ $<
  46.  
  47.  
  48. #HOME = devel:gmd/HOME
  49. #REX = $(HOME)/bin/rex
  50. #LIBDIR= -L $(HOME)/lib
  51. #INCDIR= -I $(HOME)/lib/include
  52. #
  53. #a.out: libfun.o
  54. #    $(REX) -c -s -d -g adoc.rex
  55. #    $(CC) $(CFLAGS) $(INCDIR) -c *.c
  56. #    $(CC) $(CFLAGS) $(LIBDIR) *.o -lreuse
  57.  
  58. coda: coda.c
  59.     $(CC) $(CFLAGS) -o $@ $<
  60.  
  61. coda.c: coda.yy
  62.     flex -8 -f -t >coda.c coda.yy
  63.  
  64. .PHONY: clean
  65.  
  66. clean:
  67. ifneq ($(strip $(wildcard $(prog) $(objs) lex.yy.c coda coda.c .depend core*)),)
  68.     $(RM) $(wildcard $(prog) $(objs) lex.yy.c coda coda.c .depend core*)
  69. endif
  70.  
  71.  
  72. .PHONY: depend
  73.  
  74. depend: .depend
  75.  
  76. .depend:
  77.     $(CC) $(CFLAGS) $(INCDIR) -MM *.c > .depend
  78.  
  79.  
  80. # include the dependency file (if it exists)
  81.  
  82. ifeq (.depend,$(wildcard .depend))
  83. include .depend
  84. endif
  85.