Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. CROSS_COMPILE = x86_64-w64-mingw32.static.posix-
  2. CC = $(CROSS_COMPILE)g++
  3. LD = $(CROSS_COMPILE)ld
  4. STRIP = $(CROSS_COMPILE)strip
  5. FLAGS = -O3 -flto
  6. CXXFLAGS+= $(FLAGS) -DUSE_REUSABLES -DUSE_BUILTIN_FCREATE
  7. LDFLAGS+= $(FLAGS) -lm
  8.  
  9. DESTDIR ?= /usr/local
  10.  
  11. ifdef FORCE_NO_GIT
  12. FORCE_NO_GIT = 1
  13. endif
  14. export FORCE_NO_GIT
  15.  
  16. VERSION=$$(./version.sh | head -n 1)
  17. VERSION_DPKG=$$(./version.sh dpkg)
  18. GITREV=$$(./version.sh | grep "Git")
  19.  
  20. ifdef NO_APPSIGN
  21. CXXFLAGS += -DNO_APPSIGN
  22. else
  23. LDFLAGS += -lgmp -lcrypto
  24. endif
  25.  
  26. export CXXFLAGS
  27. export LDFLAGS
  28.  
  29. # Suffix Rules
  30. .SUFFIXES: .cpp
  31.  
  32. .cpp.o:
  33. $(CC) $(CXXFLAGS) -c $<
  34.  
  35. .cpp:
  36. $(CC) $(CXXFLAGS) $< -o $@
  37.  
  38. SRC = main.cpp opcodes.cpp pass_one.cpp pass_two.cpp utils.cpp export.cpp preop.cpp directive.cpp console.cpp \
  39. expand_buf.cpp hash.cpp list.cpp parser.cpp storage.cpp errors.cpp bitmap.cpp modp_ascii.cpp opcodes_ez80.cpp
  40. OBJ = $(addsuffix .o, $(basename $(SRC)))
  41. OBJ_FILES = $(addsuffix .o, $(basename $(notdir $(SRC))))
  42.  
  43. spasm.exe: $(OBJ) Makefile
  44. $(CC) -o $@ $(OBJ_FILES) $(LDFLAGS)
  45. $(STRIP) $@
  46.  
  47. debug: CXXFLAGS+= -g
  48. debug: spasm
  49.  
  50. debugp: CXXFLAGS+= -g -DDEBUG_PRINT
  51. debugp: spasm
  52.  
  53. prep-special-build:
  54. $(MAKE) clean
  55. touch prep-special-build
  56.  
  57. opt: CXXFLAGS+= -O3
  58. opt: prep-special-build $(OBJ)
  59. touch opt
  60.  
  61. static: LDFLAGS+= -static
  62. static: spasm
  63. touch static
  64.  
  65. opt-static: opt static
  66.  
  67. tar: opt-static
  68. tar czvf spasm-ng_$(VERSION)_binary.tar.gz spasm README.md LICENSE inc/
  69.  
  70. # This is a fake Debian package builder - it uses checkinstall
  71. # to make this work.
  72. debian: opt spasm
  73. echo "SPASM-ng is a z80 assembler with extra features to support development for TI calculators." > description-pak
  74. checkinstall --requires "zlib1g, libssl1.0.0, libgmp10" \
  75. --pkgname="spasm-ng" --pkgversion="$(VERSION_DPKG)" --pkgrelease="1" \
  76. --maintainer="alberthdev@users.noreply.github.com" \
  77. --backup=no --deldoc=yes --deldesc=yes --delspec=yes \
  78. --install=no --default
  79. rm -f description-pak
  80.  
  81. install:
  82. cp spasm $(DESTDIR)/bin/spasm
  83.  
  84. check: spasm
  85. $(PYTHON) tests/test-runner.py ./spasm
  86.  
  87. coverage: CXXFLAGS+=-g -O0 --coverage
  88. coverage: LDFLAGS+=-g -O0 --coverage
  89. coverage: clean check
  90.  
  91. clean:
  92. rm -f $(OBJ) spasm description-pak spasm-ng*.deb spasm-ng*.tar.gz
  93. rm -f opt static prep-special-build
  94. rm -f *.gcno *.gcda *.gcov
  95.  
  96. version:
  97. @./version.sh set
  98. @echo "The current spasm-ng version is: $(VERSION)"
  99. @test -n "$(GITREV)" && echo "$(GITREV)" || exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement