Makefile 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #
  2. # Asterisk -- An open source telephony toolkit.
  3. #
  4. # Makefile for resource modules
  5. #
  6. # Copyright (C) 1999-2006, Digium, Inc.
  7. #
  8. # This program is free software, distributed under the terms of
  9. # the GNU General Public License
  10. #
  11. -include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
  12. MODULE_PREFIX=res
  13. MENUSELECT_CATEGORY=RES
  14. MENUSELECT_DESCRIPTION=Resource Modules
  15. all: _all
  16. include $(ASTTOPDIR)/Makefile.moddir_rules
  17. ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
  18. # cygwin has some dependencies among res_ things.
  19. # We use order-only dependencies, and then add the libraries as required.
  20. res_agi.so: | res_speech.so
  21. res_agi.so_LIBS:= -lres_speech.so
  22. endif
  23. res_config_ldap.o: _ASTCFLAGS+=-DLDAP_DEPRECATED
  24. ael/ael_lex.o: ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h
  25. ael/ael_lex.o: _ASTCFLAGS+=-I. -Iael -Wno-unused
  26. ael/ael.tab.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
  27. ael/ael.tab.o: _ASTCFLAGS+=-I. -Iael -DYYENABLE_NLS=0
  28. $(if $(filter res_ais,$(EMBEDDED_MODS)),modules.link,res_ais.so): ais/clm.o ais/evt.o
  29. ais/clm.o ais/evt.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ais)
  30. $(if $(filter res_snmp,$(EMBEDDED_MODS)),modules.link,res_snmp.so): snmp/agent.o
  31. snmp/agent.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_snmp)
  32. $(if $(filter res_ael_share,$(EMBEDDED_MODS)),modules.link,res_ael_share.so): ael/ael_lex.o ael/ael.tab.o ael/pval.o
  33. ael/ael_lex.o ael/ael.tab.o ael/pval.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ael_share)
  34. $(if $(filter res_pjsip,$(EMBEDDED_MODS)),modules.link,res_pjsip.so): $(subst .c,.o,$(wildcard res_pjsip/*.c))
  35. $(subst .c,.o,$(wildcard res_pjsip/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_pjsip)
  36. $(if $(filter res_stasis,$(EMBEDDED_MODS)),modules.link,res_stasis.so): $(subst .c,.o,$(wildcard stasis/*.c))
  37. $(subst .c,.o,$(wildcard stasis/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_stasis)
  38. ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
  39. ael/ael_lex.c: ael/ael.flex
  40. else
  41. ael/ael_lex.c:
  42. endif
  43. $(ECHO_PREFIX) echo " [FLEX] $< -> $@"
  44. $(CMD_PREFIX) (cd ael; $(FLEX) ael.flex)
  45. $(CMD_PREFIX) sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' $@ > $@.fix
  46. $(CMD_PREFIX) echo "#include \"asterisk.h\"" > $@
  47. $(CMD_PREFIX) echo >> $@
  48. $(CMD_PREFIX) cat $@.fix >> $@
  49. $(CMD_PREFIX) rm $@.fix
  50. ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
  51. ael/ael.tab.c ael/ael.tab.h: ael/ael.y
  52. else
  53. ael/ael.tab.c ael/ael.tab.h:
  54. endif
  55. $(ECHO_PREFIX) echo " [BISON] $< -> $@"
  56. $(CMD_PREFIX) (cd ael; $(BISON) -v -d ael.y)
  57. ael/pval.o: ael/pval.c
  58. clean::
  59. rm -f snmp/*.[oi] ael/*.[oi] ais/*.[oi] ari/*.[oi]
  60. rm -f res_pjsip/*.[oi] stasis/*.[oi]
  61. rm -f parking/*.o parking/*.i stasis_recording/*.[oi]
  62. $(if $(filter res_parking,$(EMBEDDED_MODS)),modules.link,res_parking.so): $(subst .c,.o,$(wildcard parking/*.c))
  63. $(subst .c,.o,$(wildcard parking/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_parking)
  64. res_ari.so: ari/cli.o ari/config.o ari/ari_websockets.o
  65. ari/cli.o ari/config.o ari/ari_websockets.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari)
  66. res_ari_model.so: ari/ari_model_validators.o
  67. ari/ari_model_validators.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_model)
  68. res_stasis_recording.so: stasis_recording/stored.o
  69. stasis_recording/stored.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_stasis_recording)
  70. # Dependencies for res_ari_*.so are generated, so they're in this file
  71. include ari.make