mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	There are times when you need to troubleshoot issues with bundled pjproject or add new features that need to be pushed upstream but... * The source directory created by extracting the pjproject tarball is not scanned for code changes so you have to keep forcing rebuilds. * The source directory isn't a git repo so you can't easily create patches, do git bisects, etc. * Accidentally doing a make distclean will ruin your day by wiping out the source directory, and your changes. * etc. This commit makes that easier. See third-party/pjproject/README-hacking.md for the details. ASTERISK-29824 Change-Id: Idb1251040affdab31d27cd272dda68676da9b268
		
			
				
	
	
		
			104 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			104 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
| .PHONY: all install clean distclean configure
 | |
| 
 | |
| .NOTPARALLEL:
 | |
| 
 | |
| include ../versions.mak
 | |
| export JANSSON_DIR := $(shell pwd -P)
 | |
| 
 | |
| SPECIAL_TARGETS :=
 | |
| 
 | |
| ifneq ($(findstring configure,$(MAKECMDGOALS)),)
 | |
| # Run from $(ASTTOPDIR)/configure
 | |
|     SPECIAL_TARGETS += configure
 | |
| endif
 | |
| 
 | |
| ifeq ($(findstring clean,$(MAKECMDGOALS)),clean)
 | |
| # clean or distclean
 | |
|     SPECIAL_TARGETS += clean
 | |
| endif
 | |
| 
 | |
| ifeq ($(findstring uninstall,$(MAKECMDGOALS)),uninstall)
 | |
|     SPECIAL_TARGETS += uninstall
 | |
| endif
 | |
| 
 | |
| 
 | |
| ifneq ($(wildcard ../../makeopts),)
 | |
|     include ../../makeopts
 | |
| endif
 | |
| 
 | |
| ifeq ($(SPECIAL_TARGETS),)
 | |
| # Run locally or from $(ASTTOPDIR)/Makefile.  All include files should be present
 | |
|     ifeq ($(wildcard ../../makeopts),)
 | |
|         $(error ASTTOPDIR/configure hasn't been run)
 | |
|     endif
 | |
| 
 | |
|     ifeq ($(JANSSON_BUNDLED),yes)
 | |
|         ifneq ($(wildcard ../../menuselect.makeopts),)
 | |
|             include ../../menuselect.makeopts
 | |
|         else
 | |
|             $(warning ASTTOPDIR/menuselect hasn't been run yet.  Can't find debug options.)
 | |
|         endif
 | |
| 
 | |
|         all: dest/include/jansson.h
 | |
|     else
 | |
|         all:
 | |
|     endif
 | |
| endif
 | |
| 
 | |
| include ../../Makefile.rules
 | |
| include ../Makefile.rules
 | |
| include Makefile.rules
 | |
| 
 | |
| OPTIMIZE_CFLAGS = -g3
 | |
| ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
 | |
|     OPTIMIZE_CFLAGS += $(OPTIMIZE)
 | |
| endif
 | |
| 
 | |
| ECHO_PREFIX := $(ECHO_PREFIX) echo '[jansson] '
 | |
| SHELL_ECHO_PREFIX := echo '[jansson] '
 | |
| 
 | |
| dest/include/jansson.h: source/config.status
 | |
| 	$(ECHO_PREFIX) Building bundled jansson.
 | |
| 	$(CMD_PREFIX) (cd source; make $(REALLY_QUIET))
 | |
| 	$(CMD_PREFIX) (cd source; make install DESTDIR= $(REALLY_QUIET))
 | |
| 
 | |
| .DELETE_ON_ERROR:
 | |
| 
 | |
| $(DOWNLOAD_DIR)/$(TARBALL_FILE): ../versions.mak
 | |
| 	$(CMD_PREFIX) ($(TARBALL_EXISTS) && $(TARBALL_VERIFY) && touch $@) || (rm -rf $@ ;\
 | |
| 	$(TARBALL_DOWNLOAD)) || (rm -rf $@ ;\
 | |
| 	$(SHELL_ECHO_PREFIX) Retrying download ; $(TARBALL_DOWNLOAD))
 | |
| 
 | |
| source/.unpacked: $(DOWNLOAD_DIR)/$(TARBALL_FILE)
 | |
| 	$(CMD_PREFIX) $(TARBALL_VERIFY) || (rm -rf $@ ;\
 | |
| 	$(SHELL_ECHO_PREFIX) Retrying download ; $(TARBALL_DOWNLOAD))
 | |
| 	$(ECHO_PREFIX) Unpacking $<
 | |
| 	-@rm -rf source jansson-*/ >/dev/null 2>&1
 | |
| 	$(CMD_PREFIX) $(TAR) -xjf $<
 | |
| 	@mv jansson-$(JANSSON_VERSION) source
 | |
| 	$(ECHO_PREFIX) Applying patches "$(realpath patches)" "$(realpath .)/source"
 | |
| 	$(CMD_PREFIX) ../apply_patches $(QUIET_CONFIGURE) "$(realpath patches)" "$(realpath .)/source"
 | |
| 	-@touch source/.unpacked
 | |
| 
 | |
| .rebuild_needed: $(wildcard ../../.lastclean)
 | |
| 	$(ECHO_PREFIX) Rebuilding
 | |
| 	$(CMD_PREFIX) $(MAKE) clean $(REALLY_QUIET)
 | |
| 
 | |
| source/config.status: source/.unpacked Makefile.rules .rebuild_needed
 | |
| 	$(ECHO_PREFIX) Configuring
 | |
| 	$(CMD_PREFIX) (cd source ; ./configure $(QUIET_CONFIGURE) $(JANSSON_CONFIG_OPTS) --disable-shared \
 | |
| 		--enable-static --prefix=$(JANSSON_DIR)/dest --libdir=$(JANSSON_DIR)/dest/lib CFLAGS="$(OPTIMIZE_CFLAGS)")
 | |
| 
 | |
| configure: source/config.status
 | |
| 
 | |
| install:
 | |
| uninstall:
 | |
| 
 | |
| clean:
 | |
| 	$(ECHO_PREFIX) Cleaning
 | |
| 	+-$(CMD_PREFIX) test -d source && $(SUBMAKE) -C source clean $(REALLY_QUIET) || :
 | |
| 
 | |
| distclean:
 | |
| 	$(ECHO_PREFIX) Distcleaning
 | |
| 	-$(CMD_PREFIX) rm -rf source jansson-*.tar.bz2 .rebuild_needed
 |