Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve Makefile #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marler8997
Copy link

@marler8997 marler8997 commented Mar 8, 2021

Here are a list of the improvements done to the Makefile.

  1. allow tests to be built and run individually from the command-line:

Examples of building individual tests:

make bin/test1
make bin/test2
...

Running individual tests:

make test1
make test2
make test_compile
make test_rand
make test_rand_neg

# note: you can still run all the tests with
make test
  1. Because building and running the tests are now in their own rules, the user can run them in parallel:

Build everything in parallel with 5 threads:

make -j5

Build and run everything with 5 threads:

make -j5 test
  1. Moved all outputs to the "bin" directory

This simplifies the code in the "clean" target to 1 command. It also simplifies the .gitignore file and makes it easy for developers to distinguish between output files and source files.

This also means we don't need an odd rule in .gitignore that means new files in test will be ignored by default, which means if a new file is added to test then the programmer must run git add -f test/file and git status also doesn't notify them if they forgot to do this.

  1. Added re.c as a dependency to all the tests

Now if the user modifies re.c, all the tests will see that they need to be rebuilt.

Here are a list of the improvements done to the Makefile.

1. allow tests to be built and run individually from the command-line:

Examples of building individual tests:
```
make bin/test1
make bin/test2
...
```

Running individual tests:
```sh
make test1
make test2
make test_compile
make test_rand
make test_rand_neg

# note: you can still run all the tests with
make test
```

2. Because building and running the tests are now in their own rules, the user can run them in parallel now:

Build everything in parallel with 5 threads:
```
make -j5
```

Build and run everything with 5 threads:
```
make -j5 test
```

3. Moved all outputs to the "bin" directory

This simplifies the code in the "clean" target to 1 command. It also simplifies the .gitignore file and make it easy for developers to distinguish between output files and source files.

4. Added re.c as a dependency to all the tests

Now if the user modifies re.c, all the tests will be see that they need to be rebuilt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant