uni

University stuff
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

Makefile (689B)


      1 TARGET = inheritance
      2 #INSTALL_PATH = /usr/local/bin
      3 
      4 SRC_DIR = src
      5 OBJ_DIR = obj
      6 BIN_DIR = bin
      7 
      8 SRC = $(wildcard $(SRC_DIR)/*.cpp)
      9 OBJ = $(SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
     10 
     11 MOVE = mv
     12 MKDIR_P = mkdir -p
     13 
     14 CC = g++
     15 CPPFLAGS += -Iinclude -pedantic
     16 CFLAGS += -Wall -std=c++17 -O3
     17 LDFLAGS += -Llib
     18 #LDLIBS += -lm 
     19 
     20 .PHONY: all clean
     21 
     22 all: $(TARGET)
     23 
     24 $(TARGET): $(OBJ)
     25 	$(MKDIR_P) $(BIN_DIR)
     26 	$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
     27 	$(MOVE) $(TARGET) $(BIN_DIR)
     28 
     29 $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
     30 	$(MKDIR_P) $(OBJ_DIR)
     31 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
     32 
     33 run:
     34 	./$(BIN_DIR)/$(TARGET)
     35 
     36 install: $(TARGET)
     37 	cp $(BIN_DIR)/$(TARGET) $(INSTALL_PATH)
     38 	
     39 clean:
     40 	$(RM) $(OBJ) $(BIN_DIR)/$(TARGET)