weRginger / binarywarriors

Automatically exported from code.google.com/p/binarywarriors
0 stars 0 forks source link

Script to create the required directory hierarchy. #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. Description of the problem :

We will use the following directory hierarchy for organizing our code. 

mycode 
|-- kernel
|   `-- Makefile
|-- Makefile
|-- README
|-- run
|-- test
|   |-- data
|   |-- kernel
|   `-- user
`-- user
    `-- Makefile

mycode -- This will the issue number if the code is for an exercise.

It has directories kernel, user, test

It has a Makefile

It has a run file which is a shell script

The directories kernel, user and test has Makefiles

The directory test has three directories kernel, user and data

Now I want to write the Makefiles in such a manner that when I run the makefile 
in the mycode directory it should accept these inputs

make all -- it will compile the full code
make kernel -- it will compile the kernel code
make user -- it will compile the user code
make test -- it will compile the test directories code.

./run reset -- it should remove the old modules and other such kernel 
configuration done by you.

./run kernel -- should insert the kernel modules and make the environment ready 
for user space program to run.

./run user -- should run the user space program for the kernel code

./run test -- should run the test suite.

Write a script which when fired will create the above directory hierarchy.

2. How to test :

We have old programs like linked lists etc. which should be arranged in this 
hierarchy. This will be a good test suite.

3. Concepts :

Makefiles, code organization, shell scripts.

4. References :

BLP and Internet

5. Code Location :

exercises/07/

Original issue reported on code.google.com by binarywarriors5@gmail.com on 3 Oct 2010 at 1:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Attached files includes the following

1. Directory : 
 Script to make the directory hierarchy.

2. Mycode :
 Directory that includes all the source codes related to kernel user and test. Also, include make files for the above mentioned directory.

Original comment by gupta.pa...@gmail.com on 6 Oct 2010 at 2:42

Attachments:

GoogleCodeExporter commented 9 years ago
The code looks fine and seems to be working but needs a lot of improvement. The 
directories are hard coded, remove them and use MARCOs instead.

All of us should use these script for the exercises done henceforth. This will 
also test the script properly.

Instead of using a if-else ladder you can use the switch statement.

I hope you have read the BLP Chapter 2 for this, if no then do it.

Original comment by binarywarriors5@gmail.com on 9 Oct 2010 at 5:03