summaryrefslogtreecommitdiff
path: root/AK/Tests/Makefile
blob: 380c9eab606fc90911906d484c7940c0eeb1a73a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
PROGRAMS = TestString TestQueue TestVector TestHashMap TestJSON TestWeakPtr TestNonnullRefPtr TestRefPtr TestFixedArray TestFileSystemPath

CXXFLAGS = -std=c++17 -Wall -Wextra -ggdb3 -O2 -I../ -I../../

SHARED_TEST_OBJS = \
	../String.o \
	../StringImpl.o \
	../StringBuilder.o \
	../StringView.o \
	../LogStream.o \
	../JsonArray.o \
	../JsonObject.o \
	../JsonValue.o \
	../JsonParser.o \
    ../FileSystemPath.o \

.cpp.o:
	@echo "HOST_CXX $<"; $(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ -c $<

define execute-command
$(1)

endef

all: $(PROGRAMS)
	$(foreach x,$(PROGRAMS),$(call execute-command,./$(x)))

TestString: TestString.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestString.o $(SHARED_TEST_OBJS)

TestQueue: TestQueue.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestQueue.o $(SHARED_TEST_OBJS)

TestVector: TestVector.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestVector.o $(SHARED_TEST_OBJS)

TestFixedArray: TestFixedArray.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestFixedArray.o $(SHARED_TEST_OBJS)

TestHashMap: TestHashMap.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestHashMap.o $(SHARED_TEST_OBJS)

TestJSON: TestJSON.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestJSON.o $(SHARED_TEST_OBJS)

TestWeakPtr: TestWeakPtr.o $(SHARED_TEST_OBJS) 
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestWeakPtr.o $(SHARED_TEST_OBJS)

TestNonnullRefPtr: TestNonnullRefPtr.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestNonnullRefPtr.o $(SHARED_TEST_OBJS)

TestRefPtr: TestRefPtr.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestRefPtr.o $(SHARED_TEST_OBJS)

TestOptional: TestOptional.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestOptional.o $(SHARED_TEST_OBJS)

TestFileSystemPath: TestFileSystemPath.o $(SHARED_TEST_OBJS)
	$(PRE_CXX) $(CXX) $(CXXFLAGS) -o $@ TestFileSystemPath.o $(SHARED_TEST_OBJS)


clean:
	rm -f $(SHARED_TEST_OBJS)
	rm -f $(PROGRAMS)