|
|
@ -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 |
|
|
@ -17,16 +18,26 @@ endif |
|
|
|
|
|
|
|
all: $(EXE) |
|
|
|
|
|
|
|
$(LIB): $(OBJS) |
|
|
|
$(LIB_STATIC): $(OBJS) |
|
|
|
$(AR) -rc $@ $(OBJS_LIB) |
|
|
|
|
|
|
|
$(EXE) : $(LIB) |
|
|
|
$(EXE) : $(LIB_STATIC) |
|
|
|
|
|
|
|
clean: |
|
|
|
rm -rf \
|
|
|
|
$(OBJS) \
|
|
|
|
$(EXE) \
|
|
|
|
$(LIB) \
|
|
|
|
*.d \
|
|
|
|
$(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) |
|
|
|