summaryrefslogtreecommitdiff
path: root/AK/Tests/Makefile
blob: 13581e07587e4b997af91df97c8d76529ee16c77 (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
SHARED_TEST_SOURCES = \
	../String.cpp \
	../StringImpl.cpp \
	../StringBuilder.cpp \
	../StringView.cpp \
	../LogStream.cpp \
	../JsonValue.cpp \
	../JsonParser.cpp \
    ../FileSystemPath.cpp \
    ../URL.cpp \
    ../Utf8View.cpp

SRCS = $(wildcard *.cpp)
SHARED_TEST_OBJS = ${SHARED_TEST_SOURCES:.cpp=.host.o}
OBJS = ${SRCS:.cpp=.host.o} $(SHARED_TEST_OBJS)
APPS = ${SRCS:.cpp=}

EXTRA_CLEAN = $(APPS) *.o

HOST_CXX = 1

include ../../Makefile.common

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

APPS_RUN = $(addsuffix .run,$(APPS))
test: $(APPS) $(APPS_RUN)
$(APPS_RUN): %.run:
	./$*

$(APPS): %: %$(OBJ_SUFFIX).o $(SHARED_TEST_OBJS)
	@echo "LINK $@"
	$(QUIET) $(CXX) -o $@ $< $(SHARED_TEST_OBJS) $(LDFLAGS)

all: | $(APPS) $(APPS_RUN)