Sponsored Content
Top Forums Shell Programming and Scripting Copy directories in make file Post 302888158 by ushacy on Thursday 13th of February 2014 01:39:14 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
GO-CLEAN(1)						      General Commands Manual						       GO-CLEAN(1)

NAME
go - tool for managing Go source code SYNOPSIS
go clean [-i] [-r] [-n] [-x] [ packages ] DESCRIPTION
Clean removes object files from package source directories. The go command builds most objects in a temporary directory, so go clean is mainly concerned with object files left by other tools or by manual invocations of go build. Specifically, clean removes the following files from each of the source directories corresponding to the import paths: _obj/ old object directory, left from Makefiles _test/ old test directory, left from Makefiles _testmain.go old gotest file, left from Makefiles test.out old test log, left from Makefiles build.out old test log, left from Makefiles *.[568ao] object files, left from Makefiles DIR(.exe) from go build DIR.test(.exe) from go test -c MAINFILE(.exe) from go build MAINFILE.go In the list, DIR represents the final path element of the directory, and MAINFILE is the base name of any Go source file in the directory that is not included when building the package. OPTIONS
-i The -i flag causes clean to remove the corresponding installed archive or binary (what 'go install' would create). -n The -n flag causes clean to print the remove commands it would execute, but not run them. -r The -r flag causes clean to be applied recursively to all the dependencies of the packages named by the import paths. -x The -x flag causes clean to print remove commands as it executes them. For more about specifying packages, see go-packages(7). AUTHOR
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others). 2012-05-13 GO-CLEAN(1)
All times are GMT -4. The time now is 07:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy