implement my first regexp
This commit is contained in:
parent
a78c4b1a33
commit
f66c7ff5b8
31
Makefile
31
Makefile
|
@ -28,30 +28,35 @@ FILES := $(notdir $(basename $(SRCS)))
|
||||||
OBJS := $(addprefix $(OBJ_DIR)/,$(addsuffix .o,$(FILES)))
|
OBJS := $(addprefix $(OBJ_DIR)/,$(addsuffix .o,$(FILES)))
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------
|
||||||
all:
|
all:
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
||||||
|
|
||||||
|
=======
|
||||||
|
#---------------------------------------------------
|
||||||
|
>>>>>>> b5b04b6 (implement my first regexp)
|
||||||
execute: linking
|
execute: linking
|
||||||
@ echo execute...
|
@ echo execute...
|
||||||
@ ./$(TARGET)
|
@ ./$(TARGET)
|
||||||
@ echo ...terminate
|
@ echo ...terminate
|
||||||
|
#---------------------------------------------------
|
||||||
linking: $(OBJS)
|
linking: $(OBJS)
|
||||||
@ echo linking
|
@ echo linking
|
||||||
@ $(CXX) $(WFLAGS) $(OFLAG) $(TARGET) $(OBJS)
|
@ $(CXX) $(WFLAGS) $(OFLAG) $(TARGET) $(OBJS)
|
||||||
|
#---------------------------------------------------
|
||||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(OBJ_DIR)
|
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(OBJ_DIR)
|
||||||
@ echo compile $<
|
@ echo compile $<
|
||||||
@ $(CXX) $(WFLAGS) -c $< $(OFLAG) $@ $(INCLUDE)
|
@ $(CXX) $(WFLAGS) -c $< $(OFLAG) $@ $(INCLUDE)
|
||||||
|
#---------------------------------------------------
|
||||||
$(OBJ_DIR):
|
$(OBJ_DIR):
|
||||||
mkdir -p $(OBJ_DIR)
|
mkdir -p $(OBJ_DIR)
|
||||||
|
#---------------------------------------------------
|
||||||
clean:
|
clean:
|
||||||
@ rm -rf $(OBJ)
|
@ rm -rf $(OBJ)
|
||||||
|
#---------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
# random git command
|
# random git command
|
||||||
|
@ -76,6 +81,22 @@ _remove: git_rm git_push
|
||||||
git_rm:
|
git_rm:
|
||||||
git rm --cached $(FILE)
|
git rm --cached $(FILE)
|
||||||
|
|
||||||
|
git_reset: _dump _reset
|
||||||
|
|
||||||
|
_reset:
|
||||||
|
git reset --hard HEAD^
|
||||||
|
|
||||||
|
# awk work with regexp
|
||||||
|
# the expression is $1 ~ /commit/ { print $2 }:
|
||||||
|
# $N -> nth word
|
||||||
|
# ~ -> when the operand coincide is true
|
||||||
|
# /word/: -> the word appears
|
||||||
|
# translate: write only the second word
|
||||||
|
# where appears "commit" in first field
|
||||||
|
|
||||||
|
_dump:
|
||||||
|
@ git log | awk '$$1 ~ /commit/ { print $$2 }' > dump_git_tree.txt
|
||||||
|
|
||||||
|
|
||||||
# difference between local and git
|
# difference between local and git
|
||||||
git_diff:
|
git_diff:
|
||||||
|
|
Loading…
Reference in New Issue