You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.6KB

  1. #
  2. # Common lib makefile for GCC / Linux target
  3. #
  4. #
  5. #
  6. # In order to extend existing targets, add
  7. # your targets to the
  8. #
  9. # HELP_RULES - extends "help" target
  10. # INSTALL_RULES - extends "install" target
  11. # BIN_RULES - extends "bin" target
  12. # CLEAN_RULES - extends "clean" target
  13. # REALCLEAN_RULES - extends "realclean" target
  14. #
  15. # variables
  16. #
  17. #
  18. #
  19. # Determine TARGET filename if only TARGET_BASENAME name is known
  20. #
  21. ifeq ("$(TARGET)","")
  22. TARGET=$(TARGET_BASENAME).a
  23. endif
  24. CFLAGS+= -fPIC
  25. CPPFLAGS+= -fPIC
  26. CPPFLAGS += -I"$(VSVR_BASE_DIR)/dep/yac/" -DLINUX $(EXTRAFLAGS)
  27. # -DYAC_FORCE_NO_TLS
  28. EXTRALIBS +=
  29. #
  30. # Build plugin library
  31. #
  32. bin: $(BIN_RULES) $(ALL_OBJ)
  33. # $(LD) $(LDFLAGS_SIZE) -OUT:$(TARGET) $(ALL_OBJ) $(EXTRALIBS)
  34. $(AR) r $(TARGET) $(ALL_OBJ)
  35. # $(EXTRALIBS)
  36. @ls -1l $(TARGET)
  37. @echo "Build finished at `date +%H:%M`."
  38. .cpp.o:
  39. $(CC) $(CPPFLAGS) $(OPTFLAGS_PLUGIN) -c "$<" -o"$@"
  40. .cc.o:
  41. $(CC) $(CPPFLAGS) $(OPTFLAGS_PLUGIN) -c "$<" -o"$@"
  42. .c.o:
  43. $(CC) $(CPPFLAGS) $(OPTFLAGS_PLUGIN) -c "$<" -o"$@"
  44. #
  45. # Install plugin
  46. # (Note: cannot depend on "bin" target since this would overwrite the UPX compressed file..)
  47. #
  48. .PHONY: install
  49. install: $(INSTALL_RULES)
  50. $(CP) $(TARGET) $(LIB_INSTALL_PREFIX)
  51. @echo "[...] $(TARGET) installed to \"$(LIB_INSTALL_PREFIX)\".";
  52. #
  53. # Make clean and remove backup files
  54. #
  55. .PHONY: realclean
  56. realclean: $(REALCLEAN_RULES) clean
  57. $(RM) `$(FIND) . -name \*\~` $(TARGET) *.exp *.lib *.plg *.ncb *.map *.manifest *.a
  58. #
  59. # Remove object files and targets.
  60. #
  61. .PHONY: clean
  62. clean: $(CLEAN_RULES)
  63. @echo "[...] cleaning up.."
  64. $(RM) $(ALL_OBJ) $(TARGET)