Skip to content

Commit

Permalink
chore: fix the makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
adamperkowski committed Jan 12, 2025
1 parent 380d783 commit 21372ef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/jule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,14 @@ jobs:
echo "$(pwd)/bin" >> $GITHUB_PATH
cd ..
- name: Test
- name: Run checks
run: |
julec test cliq
- name: Format
run: |
julefmt -w cliq
cd examples
make format
- name: Build examples
run: |
cd examples
make all
make .PHONY
- name: Clean up
run: |
rm -rf .julec .julefmt **/.*out **/bin
make clean
- name: Check formatting
run: |
Expand Down
23 changes: 15 additions & 8 deletions examples/Makefile → Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@
JULEC = julec
JULEFMT = julefmt

EXAMPLES = simple
NAME = cliq
EXAMPLES = simpleGET

all:
mkdir -p bin
examples:
mkdir -p examples/bin
@for example in $(EXAMPLES); do \
cd $$example; \
cd examples/$$example; \
$(JULEC) . -o ../bin/$$example; \
cd ..; \
cd ../..; \
done

format:
$(JULEFMT) -w $(NAME)
@for example in $(EXAMPLES); do \
$(JULEFMT) -w $$example; \
$(JULEFMT) -w examples/$$example; \
done

test:
mkdir -p bin
$(JULEC) test $(NAME) -o bin/$(NAME)_test
./$(NAME)_test

clean:
rm -rf bin
rm -rf examples/bin

.PHONY: all format clean
.PHONY: examples format test clean
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This directory contains examples of how to use the cliq library.

You can compile all the examples using:
```bash
$ make all
$ make examples
```
Executables will be placed in the `bin` directory.
Executables will be placed in the `examples/bin` directory.

## Simple
Demonstrates how to create a simple CLI application with custom commands.
Expand Down

0 comments on commit 21372ef

Please sign in to comment.