diff options
| author | Aiden Gall <aiden@aidengall.xyz> | 2025-02-09 18:02:15 +0000 |
|---|---|---|
| committer | Aiden Gall <aiden@aidengall.xyz> | 2025-02-09 18:02:15 +0000 |
| commit | d52282ec3292a1e366d3837e56ef1fb5f07ce178 (patch) | |
| tree | f3b52e1d2aa44fd88808ab9da6530df3ffee0935 /Makefile | |
initial commit
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4d70e09 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +.PHONY: all static dynamic clean +.PHONY: install install_static install_dynamic install_man install_hdr + +VERSION = 0.1 +PREFIX = /usr/local +MANPREFIX = ${PREFIX}/share/man + +CC = gcc +AR = ar + +all: static dynamic +static: libtco.a +dynamic: libtco.so + +tco.o: tco.asm config.inc + +libtco.a: tco.o + ${AR} -crs $@ $^ + +libtco.so: tco.o + ${CC} -shared $^ -o $@ ${LDFLAGS} + +%.o: %.asm + fasm $< $@ + +clean: + rm -f tco.o libtco.a libtco.so + +install: install_static install_dynamic + +install_static: static install_man install_hdr + install -Dm644 libtco.a ${DESTDIR}${PREFIX}/lib64/libtco.a + +install_dynamic: dynamic install_man install_hdr + install -Dm755 libtco.so ${DESTDIR}${PREFIX}/lib64/libtco.so + +install_hdr: + install -Dm644 tco.h ${DESTDIR}${PREFIX}/include/tco.h + +install_man: + install -Dm644 tco_go.3 ${DESTDIR}${MANPREFIX}/man3/tco_go.3 + install -Dm644 tco_yield.3 ${DESTDIR}${MANPREFIX}/man3/tco_yield.3 |
