summaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile51
1 files changed, 46 insertions, 5 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 82c1d44..56968e5 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,14 +1,55 @@
# Makefile for the pthreads test suite.
# If all of the .pass files can be created, the test suite has passed.
+
+CP = copy
+RM = erase
+TOUCH = echo Passed >
+
+#
+# Mingw32
+#
+CC = gcc
+CFLAGS = -g -O2 -UNDEBUG -Wall -o $@ $^
+BUILD_DIR = ../build
+RELEASE_DIR = ../release
+INCLUDES = -I$(BUILD_DIR)/include
+LIBS = $(BUILD_DIR)/lib/libpthread32.a
+
+##
+## MSVC
+##
+#CC = cl
+#CFLAGS = /W3 /MT /nologo /Yd /Zi /Fe$@ $^
+#BUILD_DIR = ..\build
+#RELEASE_DIR = ..\release
+#INCLUDES = -I$(BUILD_DIR)\include
+#LIBS = $(BUILD_DIR)\lib\pthread.lib
+
+DLL = pthread.dll
+
# If a test case returns a non-zero exit code to the shell, make will
# stop.
-PASSES = count1.pass create1.pass equal1.pass exit1.pass exit2.pass \
- exit3.pass eyal1.pass mutex1.pass mutex2.pass mutex3.pass \
- once1.pass self1.pass self2.pass self3.pass tsd1.pass
+TESTS = count1 create1 equal1 exit1 exit2 \
+ exit3 eyal1 mutex1 mutex2 mutex3 \
+ once1 self1 self2 self3 tsd1
+
+PASSES = $(TESTS:%=%.pass)
all: $(PASSES)
-%.pass: %.exe
- touch $@
+%.pass: %.exe $(DLL)
+ $*
+ $(TOUCH) $@
+
+%.exe: %.c
+ $(CC) $(CFLAGS) $(INCLUDES) $(LIBS)
+
+$(DLL):
+ $(CP) ..\build\bin\$@ .
+
+clean:
+ - $(RM) *.exe
+ - $(RM) *.pass
+