summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-06-25 19:08:08 -0700
committerJulian Blake Kongslie2022-06-25 19:08:08 -0700
commitac6286bc9332128da724dbdbaa63fb8236112094 (patch)
tree244daa4a70d3d619ca8e1e232c635a5878ec3ad1
parentMove EvalState and the eval coroutines to a separate header. (diff)
downloadissim-ac6286bc9332128da724dbdbaa63fb8236112094.tar.xz
Support header-only components.
Diffstat (limited to '')
-rw-r--r--Makefile35
-rw-r--r--aisa/aisa.cpp7
2 files changed, 22 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 28dd7f6..c8286f5 100644
--- a/Makefile
+++ b/Makefile
@@ -9,15 +9,34 @@ CXXFLAGS := -Wall -Werror -std=c++20 -fPIC -iquote . ${OPTIMIZE} ${DEBUG}
9libname = $(shell realpath --canonicalize-missing --relative-to . build/$(dir $(1))/lib$(notdir $(1))) 9libname = $(shell realpath --canonicalize-missing --relative-to . build/$(dir $(1))/lib$(notdir $(1)))
10 10
11PARTS := $(shell find * -type d -\( -name build -prune -o -name tools -prune -o -print -\)) 11PARTS := $(shell find * -type d -\( -name build -prune -o -name tools -prune -o -print -\))
12PARTARS := $(foreach part, ${PARTS}, $(call libname, ${part}.a)) 12PARTARS :=
13PARTSOS := $(foreach part, ${PARTS}, $(call libname, ${part}.so)) 13PARTSOS :=
14 14
15MAINOBJS := $(patsubst %.cpp, build/%.o, $(wildcard *.cpp)) 15MAINOBJS := $(patsubst %.cpp, build/%.o, $(wildcard *.cpp))
16MAINOBJS += build/git-tag.o 16MAINOBJS += build/git-tag.o
17 17
18HEADERS := $(find -type f -name \*.h) 18HEADERS := $(find -type f -name \*.h)
19 19
20all: issim 20.DEFAULT: issim issim-static
21
22define mklib =
23
24ifneq ($(wildcard $(1)/*.cpp),)
25
26$(call libname, $(1).a): $(patsubst %.cpp, build/%.o, $(wildcard $(1)/*.cpp))
27 @mkdir -p $$(dir $$@)
28 $${AR} cr $$@ $$+
29
30$(call libname, $(1).so): $(patsubst %.cpp, build/%.o, $(wildcard $(1)/*.cpp))
31 @mkdir -p $$(dir $$@)
32 $${CXX} $${CXXFLAGS} -shared -o $$@ $$+
33
34PARTARS += $(call libname, $(1).a)
35PARTSOS += $(call libname, $(1).so)
36
37endif
38
39endef
21 40
22issim: build/issim-dynamic 41issim: build/issim-dynamic
23 @ln -sf $< $@ 42 @ln -sf $< $@
@@ -54,16 +73,6 @@ build/%.o: build/%.cpp
54 @mkdir -p $(dir $@) 73 @mkdir -p $(dir $@)
55 ${CXX} ${CXXFLAGS} -MMD -c -o $@ $< 74 ${CXX} ${CXXFLAGS} -MMD -c -o $@ $<
56 75
57define mklib =
58$(call libname, $(1).a): $(patsubst %.cpp, build/%.o, $(wildcard $(1)/*.cpp))
59 @mkdir -p $$(dir $$@)
60 $${AR} cr $$@ $$+
61
62$(call libname, $(1).so): $(patsubst %.cpp, build/%.o, $(wildcard $(1)/*.cpp))
63 @mkdir -p $$(dir $$@)
64 $${CXX} $${CXXFLAGS} -shared -o $$@ $$+
65endef
66
67$(foreach part, ${PARTS}, $(eval $(call mklib, ${part}))) 76$(foreach part, ${PARTS}, $(eval $(call mklib, ${part})))
68 77
69.SUFFIXES: 78.SUFFIXES:
diff --git a/aisa/aisa.cpp b/aisa/aisa.cpp
deleted file mode 100644
index 97a3b17..0000000
--- a/aisa/aisa.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
1#include <iostream>
2
3#include "aisa/aisa.h"
4
5namespace aisa {
6
7}