aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-03-04 09:28:01 +0100
committerMattias Andrée <maandree@kth.se>2016-03-04 09:28:01 +0100
commit0a7e36380717fe926d43ab30ef6162db9bd71723 (patch)
treeb0ad75c7525688f8e54319e440b251213a4ef3db /Makefile
parentAdd zptest (diff)
downloadlibzahl-0a7e36380717fe926d43ab30ef6162db9bd71723.tar.gz
libzahl-0a7e36380717fe926d43ab30ef6162db9bd71723.tar.bz2
libzahl-0a7e36380717fe926d43ab30ef6162db9bd71723.tar.xz
Add makefile and fix errors
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile71
1 files changed, 71 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0670292
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,71 @@
+include config.mk
+
+HDR =\
+ zahl.h\
+ src/internals.h
+
+FUN =\
+ zabs\
+ zadd\
+ zand\
+ zbits\
+ zbset\
+ zbtest\
+ zcmp\
+ zcmpi\
+ zcmpmag\
+ zcmpu\
+ zdiv\
+ zdivmod\
+ zfree\
+ zgcd\
+ zinit\
+ zload\
+ zlsb\
+ zlsh\
+ zmod\
+ zmodmul\
+ zmodpow\
+ zmodpowu\
+ zmodsqr\
+ zmul\
+ zneg\
+ znot\
+ zor\
+ zpow\
+ zpowu\
+ zptest\
+ zrand\
+ zrsh\
+ zsave\
+ zset\
+ zseti\
+ zsets\
+ zsetu\
+ zsetup\
+ zsplit\
+ zsqr\
+ zstr\
+ zstr_length\
+ zsub\
+ zswap\
+ ztrunc\
+ zunsetup\
+ zxor
+
+OBJ = $(FUN:=.o)
+MAN = $(foreach F,$(FUN),man/$(F).3) man/libzahl.7
+
+all: libzahl.a
+
+%.o: src/%.c $(HDR) config.mk
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+libzahl.a: $(OBJ)
+ $(AR) rc $@ $?
+ $(RANLIB) $@
+
+clean:
+ -rm -- *.o *.su *.a *.so 2>/dev/null
+
+.PHONY: all clean