-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cb606b
commit c731ca2
Showing
24 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
blah: blah.c | ||
cc blah.c -o blah |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int main(void){ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
blah: blah.o | ||
cc blah.o -o blah # Runs third | ||
|
||
blah.o: blah.c | ||
cc -c blah.c -o blah.o # Runs second | ||
|
||
# Typically blah.c would already exist, but I want to limit any additional required files | ||
blah.c: | ||
echo "int main() { return 0; }" > blah.c # Runs first |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
int main() { return 0; } |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
some: other | ||
echo "hi gogoli" | ||
touch some | ||
other: | ||
echo "im first" |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
some_file: other_file | ||
echo "This will always run, and runs second" | ||
touch some_file | ||
|
||
other_file: | ||
echo "This will always run, and runs first" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#defining vars , vars can only be string | ||
file := file1 file2 | ||
some_file : $(file) | ||
echo "some file is called " $(file) | ||
touch some_file | ||
file1: | ||
touch file1 | ||
file2: | ||
touch file2 | ||
clean: | ||
rm -f file1 file2 some_file |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#rename the file or dir is possible with this syntax : | ||
# mv {current name of the file} {new name of the file} | ||
# remove : | ||
# rm -f {file name} | ||
|
||
a := "something" | ||
b := 'something' | ||
c := something | ||
var_test: | ||
echo "a is " $(a) | ||
echo "b is " $(b) | ||
echo "c is " $(c) | ||
echo 'b is ' $(b) | ||
|
||
# just run make to see what it prints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#from the prev example we saw there is no diff between "' but check this example out | ||
|
||
a := hi | ||
b := 'hi' | ||
c := "hi" | ||
test: | ||
printf $a | ||
printf $b | ||
printf $c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#as you know in when you run the make command without specifying the target , it will run | ||
#the first target , if you want to without specifying the target it runs some of the targets | ||
#you can do so by creating a target which calls others | ||
all: one two three | ||
|
||
one: | ||
touch one | ||
two: | ||
touch two | ||
three: | ||
touch three | ||
clean: | ||
rm -f one two three |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#when you want to do the same thing for each target , you dont have to write the same things many time | ||
#just do this | ||
|
||
all : f0.o f1.o | ||
|
||
f0.o f1.o: | ||
echo $@ | ||
# run the following , you will get what @ means here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# % and * are both wildcard | ||
# * searches file system for what we want | ||
# Print out file information about every .c file | ||
|
||
#uncomment this later | ||
#all: create print | ||
#create: | ||
# echo "int main(){return0;}" > test.c | ||
|
||
print: $(wildcard *.c) | ||
ls -l $? | ||
#if wildcard is not used , it will stay at *.c if no file found |