aboutsummaryrefslogtreecommitdiff
path: root/gfsm/gfsm/src/libgfsm/tests/module/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'gfsm/gfsm/src/libgfsm/tests/module/Makefile')
-rw-r--r--gfsm/gfsm/src/libgfsm/tests/module/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/gfsm/gfsm/src/libgfsm/tests/module/Makefile b/gfsm/gfsm/src/libgfsm/tests/module/Makefile
new file mode 100644
index 0000000..c310837
--- /dev/null
+++ b/gfsm/gfsm/src/libgfsm/tests/module/Makefile
@@ -0,0 +1,39 @@
+TARGETS = mod1test libmod1a.so libmod1b.so
+KNOWN_TARGETS = mod1test libmod1a.so libmod1b.so
+
+CC = gcc
+#CC = ccmalloc --no-wrapper gcc
+LD = $(CC)
+
+CPPFLAGS = $(shell pkg-config --cflags-only-I gmodule-2.0)
+#CFLAGS ?= -O2 -pipe
+#CFLAGS ?= -Wall -g
+#CFLAGS += -Wall -g
+CFLAGS ?= -g
+CFLAGS += -Wall -fPIC -DPIC
+
+LDFLAGS = $(shell pkg-config --libs-only-L gmodule-2.0)
+LIBS = $(shell pkg-config --libs-only-l gmodule-2.0) -lm
+
+LDFLAGS_MODULE = -shared $(LDFLAGS)
+
+all: $(TARGETS)
+
+##-- keep intermediate files
+.SECONDARY:
+
+##-- PATTERN: .c -> .o
+%.o: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
+
+##-- clean
+clean:
+ rm -f *.o *.lo *.tab.[ch] *.lex.[ch] $(KNOWN_TARGETS)
+
+##-- modules
+lib%.so: %.o
+ $(LD) $(LDFLAGS_MODULE) -o $@ $^ $(LIBS)
+
+##-- Executables
+%test: %test.o
+ $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)