Copy directories in make file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Copy directories in make file
# 1  
Old 02-13-2014
Copy directories in make file

Code:
LD:=C:/WindRiver/diab/5.9.3.0/WIN32/bin/dld.exe

CFILES:=$(wildcard *.c)
OBJFILES:=$(subst .c,.o, $(CFILES))
OBJ_PATH:=$(PRJ_PATH)/out/
ADDOBJFILES := $(addprefix $(OBJ_PATH),$(OBJFILES))

FILES:=C:/EB/tresos/workspace/Test_Spi/output/src 
copyfiles:
	cp  ~/C:/EB/tresos/workspace/Test_Spi/output/src/* /$(PRJ_PATH)/source/Config

OUTPUT = $(PRJ_PATH)/out/CPP_SPI

export PRJ_PATH:=$(CURDIR)

my_sources:=$(shell find '$(CURDIR)/source' -iname '*.c')
my_sources:=$(patsubst %specs.c, , $(my_sources))

my_obj_name:=$(subst .c,.o, $(my_sources))
my_obj_name += $(CURDIR)/flash_boot_header.o $(CURDIR)/flash_init_vle_Z4a.o

TARGET = -tPPCVLEES:simple		#:fssim                                                        
#TARGET = -tPPCE200Z4204N3VES:simple #:fssim  
LINKER_FILE = z4a_flash.ld


INCLUDE_FILES+=-I C:/WindRiver/diab/5.9.3.0/include

INCLUDE_FILES+=-I $(PRJ_PATH)/source/Mcu_TS_T2D35M8I0R0
INCLUDE_FILES+=-I $(PRJ_PATH)/source/Spi_TS_T2D35M8I0R0
INCLUDE_FILES+=-I $(PRJ_PATH)/source/Rte_TS_T2D35M8I0R0
INCLUDE_FILES+=-I $(PRJ_PATH)/source/Base_TS_T2D35M8I0R0
INCLUDE_FILES+=-I $(PRJ_PATH)/source/Port_TS_T2D35M8I0R0
INCLUDE_FILES+=-I $(PRJ_PATH)/source/Det_TS_T2D35M8I0R0
INCLUDE_FILES+=-I $(PRJ_PATH)/source/Dem_TS_T2D35M8I0R0
INCLUDE_FILES+=-I $(PRJ_PATH)/source/Test_App


INCLUDE_FILES+=-I $(PRJ_PATH)/source/Config
INCLUDE_FILES+=-I $(PRJ_PATH)/source/Config


CC = dcc.exe 
AS = das.exe 
LD = dld.exe


#CFLAGS = $(TARGET) -c -g  -I  $(my_sources) -Xdebug-local-cie $(INCLUDE_FILES)

$(OUTPUT).out : $(my_obj_name) $(LINKER_FILE)
	$(LD) $(TARGET) -o $(OUTPUT).elf $(my_obj_name) -lc $(LINKER_FILE) -m6 > $(OUTPUT).map
	ddump  -Rv $(OUTPUT).elf -o $(OUTPUT).srec



%.o: %.c
	$(CC) $(TARGET) -Wa,-l -c -g $(INCLUDE_FILES) -D AUTOSAR_OS_NOT_USED -o $@ $< 

%.o: %.s
	$(AS) $(TARGET) -g -o $@ $< 

all: $(OUTPUT).out

clean:
		rm -f *.o $(OUTPUT).* $(shell find '$(CURDIR)/source' -iname '*.o')  $(shell find '$(CURDIR)/source' -iname '*.lst')


build: clean all

Hi i have written a make file like this,
Now i want to copy a directory which is in C drive to my current project directory . i have written the code for it
Code:
FILES:=C:/EB/tresos/workspace/Test_Spi/output/src 
copyfiles:
	cp  ~/C:/EB/tresos/workspace/Test_Spi/output/src/* /$(PRJ_PATH)/source/Config

but it is not working, Please help me in this as this is blocking for me
# 2  
Old 02-13-2014
Moderator's Comments:
Mod Comment Posting "Does not work" without explanation does not help you or anyone. If a command does not work for you, please show the exact circumstances you used it, and the exact error or malfunction you received. Do not paraphrase errors, or post the text as links, images, or attachments if you can avoid it: Paste the exact message, in code tags, like [code] text [/code] or by selecting the text and using the Image button.

Thank you.

The UNIX and Linux Forums
# 3  
Old 02-14-2014
Thanks for your feedback,
I have mentioned clearly that i want to copy the files in a directory from C drive to my current working directry , and i have used a command in makefile like
Code:
FILES:=C:/EB/tresos/workspace/Test_Spi/output/src 
copyfiles:
	cp  FILES $(PRJ_PATH)/source/Config

here Files will be my source and Project path will be my destination and i need to copy the files to this destination folder.
# 4  
Old 02-14-2014
You've posted what you hope to accomplish.

You haven't posted what actually happens when you run make.

Please post what actually happens when you run make.

Do not paraphrase errors, or post the text as links, images, or attachments if you can avoid it: Paste the exact message, in code tags, like [code] text [/code] or by selecting the text and using the button.

If you ignore this request again I will close the thread. We are not a psychic help service.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Make a copy of a file when someone tries to modify the file

I wish to take a backup of the file when someone tries to modify a file say /tmp/test.txt using vi, vim, cat, copy, mv commands. I'm aware of inotify which will notify me of any changes to the file however, I wish to make a backup before and not after the changes are made to the file. I... (1 Reply)
Discussion started by: mohtashims
1 Replies

2. Shell Programming and Scripting

Switching between directories and mkdir/copy dir/file

I was trying to copy the files inside the path /home/user/check/Q1/dir/folder1/expected/n/a1.out1 and a1.out2 and a1.out3 to /home/user/check/Q2/dir/folder1/expected/n/ if n directory is not present at Q2/dir/folder1/expected/ then directory should be created first. And, script follow the... (5 Replies)
Discussion started by: Mannu2525
5 Replies

3. Shell Programming and Scripting

Make copy of text file with columns removed (based on header)

Hello, I have some tab delimited text files with a three header rows. The headers look like, (sorry the tabs look so messy). index group Name input input input input input input input input input input input... (9 Replies)
Discussion started by: LMHmedchem
9 Replies

4. Shell Programming and Scripting

Shell script to copy particular file from directories recursively

I have directory path in which there are several sub directories. In all these sub dir there will be one env.cnf file. I want to copy this env.cnf file from each sub dir's and place them in destination path by creating same filename as sub dir_env.cnf. After copying env.cnf files from source... (4 Replies)
Discussion started by: Optimus81
4 Replies

5. UNIX for Dummies Questions & Answers

copy file using unix in multiple directories

Hi All Genious, I want to copy a file name XYZ .In a directory /HOME/dir/IXOS1/dir1 which contain multiple directories named not in pattern want to copy the XYZ in all of the directories available on path /HOME/dir/IXOS1/dir1 . Thanks in advance . (2 Replies)
Discussion started by: mumakhij
2 Replies

6. Shell Programming and Scripting

Find all .htaccess files and make a backup copy in respective directories

Hey guys, I need to know how to locate all .htaccess files on the server and make a backup of them in the folder they reside before I run a script to modify all of them. So basically taking dir1/.htaccess and copying it as dir1/.htaccess_bk dir2/.htaccess copying as dir2/.htaccess_bk... (5 Replies)
Discussion started by: boxx
5 Replies

7. UNIX for Dummies Questions & Answers

help with simple unix file copy and output in directories

Hi, I am fairly new to unix, and am trying to copy all files with the name "*.cons" within a directory (and all of the many directories within it) to a new directory called "output". There are multiple nested directories, and I would like to just pull out the files with ".cons" and not the other... (5 Replies)
Discussion started by: euspilapteryx
5 Replies

8. UNIX for Dummies Questions & Answers

Copy file into directories and sub-directories

Hello- I need to copy a file into multiple directories, and each directory's sub-directories (of which there are 5) Currently, the parent directory is set up like this: dir1 sub-dir1 sub-dir2 sub-dir3 sub-dir4 sub-dir5 dir2 sub-dir1 sub-dir2 sub-dir3 ... (1 Reply)
Discussion started by: penlok
1 Replies

9. UNIX for Dummies Questions & Answers

Copy single file to multiple directories

Please help - I need to copy a single file to multiple directories. Dir structure: Parent_Directoy Filename1 Child_Directory1 Child_Directory2 Child_Directory3 Child_Directory4 .... So I need to copy Filename1 to all of the... (2 Replies)
Discussion started by: kthatch
2 Replies

10. UNIX for Advanced & Expert Users

make 150 directories

Hi, I look for a script to create 150 directories : d000 d001 d002 ... ... d149 would you help me please ? I think it would be for i mkdir d$i Many thanks. PS : #uname -a AIX fserver 3 5 0050691A4C00 (2 Replies)
Discussion started by: big123456
2 Replies
Login or Register to Ask a Question