Update build
This commit is contained in:
20
Makefile
20
Makefile
@@ -8,11 +8,29 @@ include ./etc/config/$(CONFIG).mk
|
||||
include ./bench/config.mk
|
||||
|
||||
MAIN = README.org
|
||||
OBJ_FILES = $(patsubst %.cxx,%.o,$(filter-out %.hpp,$(SOURCES)))
|
||||
DEP_FILES = $(patsubst %.o,%.d,$(OBJ_FILES))
|
||||
SHARED_LIBRARY = lib/libatrip.so
|
||||
STATIC_LIBRARY = lib/libatrip.a
|
||||
|
||||
lib: ctf
|
||||
lib: $(SHARED_LIBRARY) $(STATIC_LIBRARY)
|
||||
|
||||
$(SHARED_LIBRARY): $(OBJ_FILES)
|
||||
mkdir -p $(@D)
|
||||
$(CXX) -shared $< $(CXXFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
$(STATIC_LIBRARY): $(OBJ_FILES)
|
||||
mkdir -p $(@D)
|
||||
$(AR) rcs $@ $<
|
||||
|
||||
$(SOURCES_FILE): $(MAIN) config.el
|
||||
echo -n "SOURCES = " > $@
|
||||
$(EMACS) --eval '(atrip-print-sources)' >> $@
|
||||
|
||||
print:
|
||||
$(info $(filter-out %.hpp,$(SOURCES)))
|
||||
|
||||
$(SOURCES): $(MAIN)
|
||||
$(call tangle,$<)
|
||||
|
||||
@@ -33,3 +51,5 @@ bench: $(BENCH_TARGETS)
|
||||
%.o: %.cxx
|
||||
$(CXX) -c $< $(CXXFLAGS) -o $@
|
||||
|
||||
%.d: %.cxx
|
||||
$(CXX) -M $< $(CXXFLAGS) -o $@
|
||||
|
||||
Reference in New Issue
Block a user