mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Put extra compiler flags into a variable so they are not repeated
too many times. On passing, add some comments and fix indentation a bit. On passing, i suspect that the following pattern is wrong %.eoo: %.o but in case it will be fixed in a later commit. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -11,6 +11,7 @@ | ||||
| # the GNU General Public License | ||||
| # | ||||
|  | ||||
| # Rules for various build phases. | ||||
| # Each command is preceded by a short comment on what to do. | ||||
| # Prefixing one or the other with @\# or @ or nothing makes the desired | ||||
| # behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command. | ||||
| @@ -19,52 +20,48 @@ | ||||
|  | ||||
| .PHONY: dist-clean | ||||
|  | ||||
| # extra cflags to build dependencies. Recursively expanded. | ||||
| _CFLAGS2= -MMD -MT $@ -MF .$(subst /,_,$@).d -MP | ||||
|  | ||||
| ifeq ($(NOISY_BUILD),) | ||||
|    ECHO_PREFIX=@ | ||||
|    CMD_PREFIX=@ | ||||
|     ECHO_PREFIX=@ | ||||
|     CMD_PREFIX=@ | ||||
| else | ||||
|    ECHO_PREFIX=@\#  | ||||
|    CMD_PREFIX= | ||||
|     ECHO_PREFIX=@\# | ||||
|     CMD_PREFIX= | ||||
| endif | ||||
|  | ||||
| ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),) | ||||
| # More GSM codec optimization | ||||
| # Uncomment to enable MMXTM optimizations for x86 architecture CPU's | ||||
| # which support MMX instructions.  This should be newer pentiums, | ||||
| # ppro's, etc, as well as the AMD K6 and K7.   | ||||
| #K6OPT=-DK6OPT | ||||
|     # More GSM codec optimization | ||||
|     # Uncomment to enable MMXTM optimizations for x86 architecture CPU's | ||||
|     # which support MMX instructions.  This should be newer pentiums, | ||||
|     # ppro's, etc, as well as the AMD K6 and K7.   | ||||
|     #K6OPT=-DK6OPT | ||||
|  | ||||
| OPTIMIZE?=-O6 | ||||
| ASTCFLAGS+=$(OPTIMIZE) | ||||
|     OPTIMIZE?=-O6 | ||||
|     ASTCFLAGS+=$(OPTIMIZE) | ||||
| endif | ||||
|  | ||||
| # build rules for various targets | ||||
| %.o: %.c | ||||
| 	$(ECHO_PREFIX) echo "   [CC] $< -> $@" | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) $(_CFLAGS2) | ||||
|  | ||||
| %.o: %.i | ||||
| 	$(ECHO_PREFIX) echo "   [CC] $< -> $@" | ||||
| ifeq ($(AST_DEVMODE),yes) | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP | ||||
| else | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) | ||||
| endif | ||||
| 	$(ECHO_PREFIX) echo "   [CCi] $< -> $@" | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) $(_CFLAGS2) | ||||
|  | ||||
| %.i: %.c | ||||
| 	$(ECHO_PREFIX) echo "   [CC] $< -> $@" | ||||
| ifeq ($(AST_DEVMODE),yes) | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -E $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP | ||||
| else | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -E $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) | ||||
| endif | ||||
| 	$(ECHO_PREFIX) echo "   [CPP] $< -> $@" | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -E $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) $(_CFLAGS2) | ||||
|  | ||||
| %.o: %.s | ||||
| 	$(ECHO_PREFIX) echo "   [AS] $< -> $@" | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP | ||||
| 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PTHREAD_CFLAGS) $(ASTCFLAGS) $(_CFLAGS2) | ||||
|  | ||||
| %.oo: %.cc | ||||
| 	$(ECHO_PREFIX) echo "   [CXX] $< -> $@" | ||||
| 	$(CMD_PREFIX) $(CXX) -o $@ -c $< $(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations,$(ASTCFLAGS)) -MMD -MT $@ -MF .$(subst /,_,$@).d -MP | ||||
| 	$(CMD_PREFIX) $(CXX) -o $@ -c $< $(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations,$(ASTCFLAGS)) $(_CFLAGS2) | ||||
|  | ||||
| %.c: %.y | ||||
| 	$(ECHO_PREFIX) echo "   [BISON] $< -> $@" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user