Unix Programming - makefile too simple to see

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > February 2006 > makefile too simple to see





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author makefile too simple to see
billy

2006-02-21, 5:54 pm

Here is my makefile
MKDIR := mkdir -p -m 777
TOP_DIR := dogs
COPY := /usr/bin/cp

define makedir
if ! [ -d $1 ] ; then \
$(MKDIR) $1 ; \
else \
echo "Directory '$1' exists"; \
fi
endef

..PHONY all build

all : build

build :
$(call makedir, $(TOP_DIR)/SourceTree)
$(call makedir, $(TOP_DIR)/ProductTree)

Måns Rullgård

2006-02-21, 5:54 pm

"billy" <bp1497@att.com> writes:

> Here is my makefile


And what do you want us to do with it?

> MKDIR := mkdir -p -m 777
> TOP_DIR := dogs
> COPY := /usr/bin/cp
>
> define makedir
> if ! [ -d $1 ] ; then \
> $(MKDIR) $1 ; \
> else \
> echo "Directory '$1' exists"; \
> fi
> endef


mkdir -p already does exactly that.

> .PHONY all build
>
> all : build
>
> build :
> $(call makedir, $(TOP_DIR)/SourceTree)
> $(call makedir, $(TOP_DIR)/ProductTree)
>


--
Måns Rullgård
mru@inprovide.com
billy

2006-02-21, 5:54 pm

I want to call the define, like a subroutine from many places. I dont
want to repeat it many times. mkdir is just the first function. After
I get this to work I will add more functionality to it. It will do a
sed to a file after checking it out of pvcs.

Måns Rullgård

2006-02-21, 5:54 pm

"billy" <bp1497@att.com> writes:

> I want to call the define, like a subroutine from many places. I dont
> want to repeat it many times. mkdir is just the first function. After
> I get this to work I will add more functionality to it. It will do a
> sed to a file after checking it out of pvcs.


Did you say PVCS? Do yourself a huge favor and bury that abomination
under at least 12 feet of cement right now.

--
Måns Rullgård
mru@inprovide.com
billy

2006-02-21, 5:54 pm

not my option. I'm just a lowly contractor

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com