Quantcast
Channel: Create directories using make file - Stack Overflow
Browsing all 12 articles
Browse latest View live

Answer by Rudiger Wolf for Create directories using make file

See https://www.oreilly.com/library/view/managing-projects-with/0596006101/ch12.html REQUIRED_DIRS = ... _MKDIRS := $(shell for d in $(REQUIRED_DIRS); \ do \ [[ -d $$d ]] || mkdir -p $$d; \ done)...

View Article



Answer by cmaster for Create directories using make file

make in, and off itself, handles directory targets just the same as file targets. So, it's easy to write rules like this: outDir/someTarget: Makefile outDir touch outDir/someTarget outDir: mkdir -p...

View Article

Answer by Nick Zalutskiy for Create directories using make file

Or, KISS. DIRS=build build/bins ... $(shell mkdir -p $(DIRS)) This will create all the directories after the Makefile is parsed.

View Article

Answer by SimplyKnownAsG for Create directories using make file

OS independence is critical for me, so mkdir -p is not an option. I created this series of functions that use eval to create directory targets with the prerequisite on the parent directory. This has...

View Article

Answer by stefanct for Create directories using make file

All solutions including the accepted one have some issues as stated in their respective comments. The accepted answer by @jonathan-leffler is already quite good but does not take into effect that...

View Article


Answer by Ryan Thompson for Create directories using make file

I've just come up with a fairly reasonable solution that lets you define the files to build and have directories be automatically created. First, define a variable ALL_TARGET_FILES that holds the file...

View Article

Answer by P Shved for Create directories using make file

In my opinion, directories should not be considered targets of your makefile, either in technical or in design sense. You should create files and if a file creation needs a new directory then quietly...

View Article

Answer by Jonathan Leffler for Create directories using make file

This would do it - assuming a Unix-like environment. MKDIR_P = mkdir -p .PHONY: directories all: directories program directories: ${OUT_DIR} ${OUT_DIR}: ${MKDIR_P} ${OUT_DIR} This would have to be run...

View Article


Answer by just somebody for Create directories using make file

given that you're a newbie, I'd say don't try to do this yet. it's definitely possible, but will needlessly complicate your Makefile. stick to the simple ways until you're more comfortable with make....

View Article


Create directories using make file

I'm a very new to makefiles and i want to create directories using makefile. My project directory is like this +--Project +--output +--source +Testfile.cpp +Makefile I want to put all the objects and...

View Article

Answer by Sander for Create directories using make file

src_dir := srcobj_dir := objbuild_dir := builddirs := $(src_dir) $(obj_dir) $(build_dir) # new variableall: $(dirs) $(other_dependencies) # added dependency (*before* any others)$(dirs): # rule which...

View Article

Answer by Vinu Raja Kumar C for Create directories using make file

I use the makefiles in windows environment and my simple solution is as follows,Create a target makedir and add it as a prerequisites to where ever it is required.# Default goalall: gccversion makedir...

View Article
Browsing all 12 articles
Browse latest View live




Latest Images