Skip to content
Snippets Groups Projects
Commit 9e4ebbee authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

remove relative paths and use ASTTOPDIR instead.

Give a default value to ASTTOPDIR if unset so we can at least
do a 'make clean' without too much trouble.

The proper fix, however, is to partition the top level
Makefile in a 'setup' and a 'main' part, in a way that the
'setup' part can be included from subdirs' Makefiles and
allow targets to be built without going through the
top level Makefile.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent ff8134d3
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
# the GNU General Public License # the GNU General Public License
# #
ASTTOPDIR?=..
-include $(ASTTOPDIR)/menuselect.makeopts -include $(ASTTOPDIR)/menuselect.makeopts
.PHONY: clean all uninstall .PHONY: clean all uninstall
...@@ -77,7 +78,7 @@ clean: ...@@ -77,7 +78,7 @@ clean:
rm -f aelparse.c aelbison.c conf2ael rm -f aelparse.c aelbison.c conf2ael
rm -f utils.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest rm -f utils.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest
md5.c: ../main/md5.c md5.c: $(ASTTOPDIR)/main/md5.c
@cp $< $@ @cp $< $@
astman: astman.o md5.o astman: astman.o md5.o
...@@ -86,62 +87,62 @@ astman: LIBS+=$(NEWT_LIB) ...@@ -86,62 +87,62 @@ astman: LIBS+=$(NEWT_LIB)
stereorize: stereorize.o frame.o stereorize: stereorize.o frame.o
stereorize: LIBS+=-lm stereorize: LIBS+=-lm
hashtab.c: ../main/hashtab.c hashtab.c: $(ASTTOPDIR)/main/hashtab.c
@cp $< $@ @cp $< $@
strcompat.c: ../main/strcompat.c strcompat.c: $(ASTTOPDIR)/main/strcompat.c
@cp $< $@ @cp $< $@
../main/ast_expr2.c: $(ASTTOPDIR)/main/ast_expr2.c:
@echo " [BISON] ../main/ast_expr2.y -> $@" @echo " [BISON] $(ASTTOPDIR)/main/ast_expr2.y -> $@"
@bison -o $@ -d --name-prefix=ast_yy ../main/ast_expr2.y @bison -o $@ -d --name-prefix=ast_yy $(ASTTOPDIR)/main/ast_expr2.y
../main/ast_expr2f.c: $(ASTTOPDIR)/main/ast_expr2f.c:
@echo " [FLEX] ../main/ast_expr2.fl -> $@" @echo " [FLEX] $(ASTTOPDIR)/main/ast_expr2.fl -> $@"
@flex -o $@ --full ../main/ast_expr2.fl @flex -o $@ --full $(ASTTOPDIR)/main/ast_expr2.fl
pval.c: ../res/ael/pval.c pval.c: $(ASTTOPDIR)/res/ael/pval.c
@cp $< $@ @cp $< $@
ast_expr2.c: ../main/ast_expr2.c ast_expr2.c: $(ASTTOPDIR)/main/ast_expr2.c
@cp $< $@ @cp $< $@
ast_expr2f.c: ../main/ast_expr2f.c ast_expr2f.c: $(ASTTOPDIR)/main/ast_expr2f.c
@cp $< $@ @cp $< $@
ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I../main ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I$(ASTTOPDIR)/main
pval.o : ASTCFLAGS+=-DSTANDALONE pval.o : ASTCFLAGS+=-DSTANDALONE
check_expr: check_expr.o ast_expr2.o ast_expr2f.o strcompat.o threadstorage.o clicompat.o check_expr: check_expr.o ast_expr2.o ast_expr2f.o strcompat.o threadstorage.o clicompat.o
aelbison.c: ../res/ael/ael.tab.c aelbison.c: $(ASTTOPDIR)/res/ael/ael.tab.c
@cp $< $@ @cp $< $@
aelbison.o: ASTCFLAGS+=-I../res/ael -DYYENABLE_NLS=0 aelbison.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0
pbx_ael.c: ../pbx/pbx_ael.c pbx_ael.c: $(ASTTOPDIR)/pbx/pbx_ael.c
@cp $< $@ @cp $< $@
pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
aelparse.c: ../res/ael/ael_lex.c aelparse.c: $(ASTTOPDIR)/res/ael/ael_lex.c
@cp $< $@ @cp $< $@
aelparse.o: ASTCFLAGS+=-I../res -DSTANDALONE_AEL aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE_AEL
aelparse: aelparse.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o aelparse: aelparse.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o
astobj2.c: ../main/astobj2.c astobj2.c: $(ASTTOPDIR)/main/astobj2.c
@cp $< $@ @cp $< $@
utils.c: ../main/utils.c utils.c: $(ASTTOPDIR)/main/utils.c
@cp $< $@ @cp $< $@
sha1.c: ../main/sha1.c sha1.c: $(ASTTOPDIR)/main/sha1.c
@cp $< $@ @cp $< $@
threadstorage.c: ../main/threadstorage.c threadstorage.c: $(ASTTOPDIR)/main/threadstorage.c
@cp $< $@ @cp $< $@
hashtest2.o: ASTCFLAGS+=-O0 hashtest2.o: ASTCFLAGS+=-O0
...@@ -156,9 +157,9 @@ extconf.o: extconf.c ...@@ -156,9 +157,9 @@ extconf.o: extconf.c
conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o
testexpr2s: ../main/ast_expr2f.c ../main/ast_expr2.c ../main/ast_expr2.h testexpr2s: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h
$(CC) -g -c -I../include -DSTANDALONE_AEL ../main/ast_expr2f.c -o ast_expr2f.o $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE_AEL $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2f.o
$(CC) -g -c -I../include -DSTANDALONE_AEL ../main/ast_expr2.c -o ast_expr2.o $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE_AEL $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2.o
$(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o $(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o
rm ast_expr2.o ast_expr2f.o rm ast_expr2.o ast_expr2f.o
./testexpr2s expr2.testinput ./testexpr2s expr2.testinput
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment