Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prefix ?= /usr/local
- PROG_NAME = prog
- CPPFLAGS += -O3 -Wall -std=c++17 -I./include -Wno-unused-function -Wno-sign-compare
- LIBS += -lz -lstdc++fs
- vpath %.c src
- vpath %.o src
- vpath %.hpp include
- vpath %.h include
- files := $(notdir $(wildcard src/*.cpp))
- objects := $(addprefix src/,$(files:%.cpp=%.o))
- .PHONY: all debug build install clean
- all: build
- debug: CPPFLAGS = -Wall -O0 -std=c++17 -I./include -Wno-unused-function -Wno-sign-compare -pg -D_DEBUG
- debug: build
- build: bin/$(PROG_NAME)
- bin/$(PROG_NAME) : $(objects)
- mkdir -p bin
- $(CXX) $(CPPFLAGS) -o bin/$(PROG_NAME) $^ $(LDFLAGS) $(LIBS)
- src/%.o : %.c
- $(CXX) $(CPPFLAGS) -c -o $@ $< $(LIBS)
- install:
- install bin/$(PROG_NAME) $(prefix)/bin/$(PROG_NAME)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement