Skip to content

Commit

Permalink
Merge pull request emad-elsaid#1 from carabolic/improve-makefile
Browse files Browse the repository at this point in the history
Make Makefile more explicit
  • Loading branch information
emad-elsaid authored Aug 22, 2023
2 parents a438187 + 02d8a73 commit e57c02f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
hydra
hydra
debug/
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
RELEASE_CFLAGS = -O3
DBG_CFLAGS = -g -Wall

hydra: main.c
clang -O3 -o hydra main.c
clang $(RELEASE_CFLAGS) -o hydra main.c

debug/hydra: main.c
mkdir -p debug
clang $(DBG_CFLAGS) -o debug/hydra main.c

.PHONY: build, debug, run, install
build: hydra

debug: main.c
@clang -g -Wall -o hydra main.c
debug: debug/hydra

run: debug
@./hydra hydras/git
@./debug/hydra hydras/git

install:
install -Dm755 hydra /usr/bin/hydra
Expand Down

0 comments on commit e57c02f

Please sign in to comment.