-
Notifications
You must be signed in to change notification settings - Fork 191
Create my own advanced Makefile #342
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
base: cdl-08
Are you sure you want to change the base?
Changes from 1 commit
fd29153
80cbadd
30f1e2d
438ec2b
3ae481c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| .PHONY: clean | ||
|
|
||
| # Compiler flags | ||
| CC=gcc | ||
| CFLAGS=-Wall -Wextra -std=c99 | ||
|
|
||
| # Checks if executables exist | ||
| GREETING_EXISTS := $(or $(and $(wildcard $(./greeting)),1),0): | ||
| TWOPARTER_EXISTS := $(or $(and $(wildcard $(./twoparter)),1),0): | ||
|
|
||
| # Builds two executables, greeting and twoparter | ||
| all: greeting twoparter | ||
|
|
||
| # Builds greeting with default compilation settings | ||
| greeting: greeting.c | ||
|
ericsandu marked this conversation as resolved.
Outdated
|
||
|
|
||
|
||
| # Builds executable from multiple .c files and a .h header | ||
| twoparter: part1.c part2.c header.h | ||
| $(CC) -o $@ $^ | ||
|
ericsandu marked this conversation as resolved.
Outdated
|
||
|
|
||
| # Removes executables if they exist | ||
| clean: | ||
| ifdef GREETING_EXISTS | ||
| rm greeting | ||
| endif | ||
| ifdef TWOPARTER_EXISTS | ||
| rm twoparter | ||
|
Comment on lines
+23
to
+27
|
||
| endif | ||
Uh oh!
There was an error while loading. Please reload this page.