Browse Source

Build: Add install/uninstall targets

main
heck 2 years ago
parent
commit
4095f3a5fb
  1. 8
      Makefile
  2. 15
      src/Makefile
  3. 1
      test/Makefile

8
Makefile

@ -10,4 +10,10 @@ test:
clean:
$(MAKE) -C src clean
$(MAKE) -C test clean
$(MAKE) -C test clean
install:
$(MAKE) -C src install
uninstall:
$(MAKE) -C src uninstall

15
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
*.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)

1
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))

Loading…
Cancel
Save