Makefile.orig 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. VPATH = src
  2. ifndef DEBUG_FLAG
  3. CCBASEFLAGS=-O2 -Wimplicit
  4. LDFLAGS=-s
  5. else
  6. CCBASEFLAGS=-g -Wall
  7. LDFLAGS=
  8. endif
  9. ifdef MINGW32
  10. ifeq (Cygwin,$(shell uname -o))
  11. CCBASEFLAGS += -mno-cygwin
  12. LDFLAGS += -mno-cygwin
  13. endif
  14. endif
  15. include ../config.mk
  16. include ../platform.mk
  17. CDEFINES=$(GTC_ARCH_DEFINES) -DINCL_PATH=\"$(prefix)/share/gtc/include\"
  18. CFLAGS=$(CCBASEFLAGS) $(CDEFINES)
  19. OBJFILES=\
  20. analyze.o \
  21. cmain.o \
  22. decl.o \
  23. expr.o \
  24. func.o \
  25. gen68k.o \
  26. genffp.o \
  27. genstmt.o \
  28. getasm.o \
  29. getsym.o \
  30. init.o \
  31. intexpr.o \
  32. memmgt.o \
  33. optimize.o \
  34. out68k_as.o \
  35. peep68k.o \
  36. preproc.o \
  37. reg68k.o \
  38. searchkw.o \
  39. stmt.o \
  40. sunpack.o \
  41. symbol.o \
  42. ttbin2asm.o \
  43. .PHONY: all clean install
  44. all: gtc
  45. clean:
  46. $(RM) $(OBJFILES) src/tags
  47. distclean: clean
  48. $(RM) gtc$(BIN_SUFFIX)
  49. scratchclean: distclean
  50. install: gtc
  51. mkdir -p $(prefix)/bin
  52. install gtc $(prefix)/bin/gtc
  53. splint:
  54. splint \
  55. -nestcomment -paramuse -nullassign -initallelements -fullinitblock \
  56. +charint +boolint -boolops +ptrnegate -shiftnegative \
  57. -nullret -retvalint -retvalother \
  58. -noeffect \
  59. -globstate -mustfreeonly -mustfreefresh -onlytrans -statictrans -observertrans -dependenttrans -temptrans -branchstate \
  60. $(CDEFINES) $(OBJFILES:%.o=%.c)
  61. # -nestcomment is for '//#define foo bar /* this is a comment */'
  62. # -paramuse is for unused func params
  63. # -nullassign is for 'int x CGLOB;'
  64. # -initallelements is for 'int x[5] CGLOBL;'
  65. # -fullinitblock is for 'TI_SHORT x CGLOBL;'
  66. # +charint is for 'char c = 2+1;' or 'if (c < 2+1)'
  67. # +boolint is for 'int z = (x==y);'
  68. # -boolops is for 'ptr && x'
  69. # +ptrnegate is for '!ptr'
  70. # -shiftnegative is for '1 << my_int' where 'my_int' has no known range
  71. # -noeffect is for '(void)0'
  72. # -nullret is for 'return NULL;' without '/*@null@*/' annotation
  73. # -retvalint is for 'myfunc(x);' without subsequent cast to void
  74. # -retvalother is for 'myfunc(x);' without subsequent cast to void
  75. gtc: $(OBJFILES)
  76. $(CC) -o gtc $(LDFLAGS) $(OBJFILES)
  77. %.o: %.c vcg.c error.c *.h gtpack/*.h Makefile config.mk
  78. $(CC) -c $(CFLAGS) $<