-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 1002 Bytes
/
Makefile
File metadata and controls
45 lines (33 loc) · 1002 Bytes
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
BUNDLER = z-core/zbundler.py
SRC = src/zvec.c
DIST = zvec.h
CC = gcc
CXX = g++
CFLAGS = -Wall -Wextra -std=c11 -O2 -I.
CXXFLAGS = -Wall -Wextra -std=c++11 -O2 -I.
all: bundle get_zerror_h
bundle:
@echo "Bundling $(DIST)..."
python3 $(BUNDLER) $(SRC) $(DIST)
get_zerror_h:
@echo "Using wget to add 'zerror.h'..."
wget -q "https://raw.githubusercontent.com/z-libs/zerror.h/main/zerror.h" -O "zerror.h"
clean:
@echo "Removing 'zerror.h'..."
@rm zerror.h
init:
git submodule update --init --recursive
test: bundle get_zerror_h test_c test_cpp clean
test_c:
@echo "----------------------------------------"
@echo "Building C Tests..."
@$(CC) $(CFLAGS) tests/test_main.c -o tests/runner_c
@./tests/runner_c
@rm tests/runner_c
test_cpp:
@echo "----------------------------------------"
@echo "Building C++ Tests..."
@$(CXX) $(CXXFLAGS) tests/test_cpp.cpp -o tests/runner_cpp
@./tests/runner_cpp
@rm tests/runner_cpp
.PHONY: all bundle get_zerror_h init test test_c test_cpp clean