diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-08-04 21:28:39 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-08-04 21:28:39 +0300 |
| commit | bf993be4a04bc7279f7d49ae18f185e1dca36479 (patch) | |
| tree | aa38bf9ea3c172a2847e818ff05599a15fe1c2cb | |
| parent | 09f8df9f7e1166be48cdd6b1caba0f6771dd753e (diff) | |
| download | copyjit-bf993be4a04bc7279f7d49ae18f185e1dca36479.tar.gz copyjit-bf993be4a04bc7279f7d49ae18f185e1dca36479.zip | |
move main.c to examples
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile | 17 | ||||
| -rw-r--r-- | examples/main.c (renamed from src/main.c) | 2 | ||||
| -rwxr-xr-x | tests/check | bin | 1269672 -> 0 bytes |
4 files changed, 15 insertions, 6 deletions
@@ -11,5 +11,7 @@ lib/*.d tests/*.d build copyjit +libcopyjit.a +examples/copyjit !include/copyjit !lib/gen/.gitkeep @@ -13,7 +13,7 @@ INCLUDEFLAGS = -Iinclude COMPILEFLAGS = LINKFLAGS = -all: copyjit +all: libcopyjit.a # default values CROSS_COMPILE ?= @@ -68,6 +68,7 @@ ARCH != uname -m LINT = $(COMPILE) $(LINTFLAGS) +EXAMPLE_OBJS != ./scripts/gen-deps --sources examples/main.c TEST_OBJS != ./scripts/gen-deps --sources tests/check.c OBJS != ./scripts/gen-deps --sources "$(SOURCES)" OPS != ./scripts/gen-ops --ops "$(OP_SOURCES)" @@ -98,11 +99,17 @@ docs: check: tests/check ./tests/check -tests/check: $(OBJS) $(TEST_OBJS) - $(COMPILE) build/tests/check.o build/src/copyjit.o -o tests/check +.PHONY: examples +examples: examples/copyjit -copyjit: $(OBJS) - $(COMPILE) $(OBJS) -o $@ +examples/copyjit: libcopyjit.a $(EXAMPLE_OBJS) + $(COMPILE) $(EXAMPLE_OBJS) -o $@ -L. -lcopyjit + +tests/check: libcopyjit.a $(TEST_OBJS) + $(COMPILE) $(TEST_OBJS) -o $@ -L. -lcopyjit + +libcopyjit.a: $(OBJS) + $(AR) rcs $@ $(OBJS) # todo: generate operations after cloning? a bit tricky to tell make to generate # a bunch of files only when required, maybe have a configure stage? diff --git a/src/main.c b/examples/main.c index de287f6..94e372b 100644 --- a/src/main.c +++ b/examples/main.c @@ -4,7 +4,7 @@ #include <stdio.h> #include <stddef.h> -#include "copyjit.h" +#include "../src/copyjit.h" int main() { diff --git a/tests/check b/tests/check Binary files differdeleted file mode 100755 index a904b37..0000000 --- a/tests/check +++ /dev/null |
