aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile12
2 files changed, 9 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 6f3afd4..019579b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@
!Makefile
!*/Makefile
*.a
+*.so
*.d
*.o
*.sim
diff --git a/Makefile b/Makefile
index e8f873a..1e80311 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
AR := ar
CC := gcc
-LIB := lib/libsalis.a
+SLIB := lib/libsalis.a
+DLIB := lib/libsalis.so
SOURCES := $(wildcard src/*.c)
OBJECTS := $(patsubst src/%.c,build/%.o,$(SOURCES))
DEPS := $(patsubst %.o,%.d,$(OBJECTS))
-LFLAGS := rs
+SLFLAGS := rs
+DLFLAGS := -shared
# uncomment for debug
# OFLAGS := -ggdb
@@ -18,7 +20,8 @@ CFLAGS := -Iinclude -c $(OFLAGS) -MMD -Wall -Wextra -std=c89 -pedantic-errors \
-Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition
all: $(OBJECTS)
- $(AR) $(LFLAGS) $(LIB) $(OBJECTS)
+ $(AR) $(SLFLAGS) $(SLIB) $(OBJECTS)
+ $(CC) $(DLFLAGS) -o $(DLIB) $(OBJECTS)
$(MAKE) -C tsalis
-include $(DEPS)
@@ -28,5 +31,6 @@ $(OBJECTS): $(patsubst build/%.o,src/%.c,$@)
clean:
-rm build/*
- -rm $(LIB)
+ -rm $(SLIB)
+ -rm $(DLIB)
$(MAKE) clean -C tsalis