diff --git a/Makefile b/Makefile index 6d34a31..c8840b1 100644 --- a/Makefile +++ b/Makefile @@ -10,4 +10,10 @@ test: clean: $(MAKE) -C src clean - $(MAKE) -C test clean \ No newline at end of file + $(MAKE) -C test clean + +install: + $(MAKE) -C src install + +uninstall: + $(MAKE) -C src uninstall diff --git a/src/Makefile b/src/Makefile index 62051b1..817ce10 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,12 +1,13 @@ include ../Makefile.conf -SRC:=$(wildcard *.c*) +SRC:=$(wildcard *.cc) SRC_EXE:=$(filter main_%, $(SRC)) SRC_LIB=$(filter-out main_%, $(SRC)) OBJS:=$(addsuffix .o, $(basename $(SRC))) OBJS_LIB:=$(addsuffix .o, $(basename $(SRC_LIB))) EXE:=$(basename $(SRC_EXE)) DEPS:=$(addsuffix .d, $(basename $(SRC))) +HEADERS=$(wildcard *.hh *.hxx *.h) .PHONY: all install uninstall clean .DEFAULT_GOAL:= all @@ -29,4 +30,14 @@ clean: $(LIB_STATIC) \ $(DEPS) \ *.dSYM \ - *.h.gch \ No newline at end of file + *.h.gch + +install: $(LIB_STATIC) + mkdir -p $(PREFIX)/include/heck/ + mkdir -p $(PREFIX)/lib + cp -v $(HEADERS) $(PREFIX)/include/heck/ + cp -v $(LIB_STATIC) $(PREFIX)/lib/ + +uninstall: + cd $(PREFIX)/include/heck && rm -vf $(HEADERS) + cd $(PREFIX)/lib && rm -vf $(LIB_STATIC) diff --git a/test/Makefile b/test/Makefile index bf948a1..7666c41 100644 --- a/test/Makefile +++ b/test/Makefile @@ -3,6 +3,7 @@ include ../Makefile.conf SRC:=$(wildcard *.c*) SRC_EXE:=$(filter test_%, $(SRC)) EXE:=$(basename $(SRC_EXE)) +DEPS:=$(addsuffix .d, $(basename $(SRC))) $(info src exe: $(SRC_EXE)) $(info lib: $(LIB_STATIC))