- upd
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@882 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+15
-59
@@ -1,69 +1,25 @@
|
||||
########################################################################
|
||||
####################### Makefile Template ##############################
|
||||
########################################################################
|
||||
MAKE_HOME := /home/jens/work/software/make
|
||||
|
||||
# Compiler settings - Can be customized.
|
||||
CC = g++
|
||||
CXXFLAGS = -std=c++11 -Wall
|
||||
LDFLAGS =
|
||||
CONFIG ?= debug
|
||||
TARGET ?= main
|
||||
BUILD_DIR := ./build/${CONFIG}
|
||||
|
||||
# Makefile settings - Can be customized.
|
||||
APPNAME = myapp
|
||||
EXT = .cpp
|
||||
SRCDIR = src
|
||||
OBJDIR = obj
|
||||
include ./processor.mk
|
||||
|
||||
############## Do not change anything from here downwards! #############
|
||||
SRC = $(wildcard $(SRCDIR)/*$(EXT))
|
||||
OBJ = $(SRC:$(SRCDIR)/%$(EXT)=$(OBJDIR)/%.o)
|
||||
DEP = $(OBJ:$(OBJDIR)/%.o=%.d)
|
||||
# UNIX-based OS variables & settings
|
||||
RM = rm
|
||||
DELOBJ = $(OBJ)
|
||||
# Windows OS variables & settings
|
||||
DEL = del
|
||||
EXE = .exe
|
||||
WDELOBJ = $(SRC:$(SRCDIR)/%$(EXT)=$(OBJDIR)\\%.o)
|
||||
CXX_SRCS += test/main.cpp test/test01.cpp test/test02.cpp test/TestBlock.cpp test/NullSource.cpp test/NullSink.cpp
|
||||
LIBS := -lstdc++ -lm -larmadillo
|
||||
DEFINES += -DPROCESSOR_BUFFER_USE_EXCEPTIONS
|
||||
|
||||
########################################################################
|
||||
####################### Targets beginning here #########################
|
||||
########################################################################
|
||||
SRCS := ${CXX_SRCS} ${GCC_SRCS}
|
||||
|
||||
all: $(APPNAME)
|
||||
|
||||
# Builds the app
|
||||
$(APPNAME): $(OBJ)
|
||||
$(CC) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
# Creates the dependecy rules
|
||||
%.d: $(SRCDIR)/%$(EXT)
|
||||
@$(CPP) $(CFLAGS) $< -MM -MT $(@:%.d=$(OBJDIR)/%.o) >$@
|
||||
|
||||
# Includes all .h files
|
||||
-include $(DEP)
|
||||
|
||||
# Building rule for .o files and its .c/.cpp in combination with all .h
|
||||
$(OBJDIR)/%.o: $(SRCDIR)/%$(EXT)
|
||||
$(CC) $(CXXFLAGS) -o $@ -c $<
|
||||
|
||||
################### Cleaning rules for Unix-based OS ###################
|
||||
# Cleans complete project
|
||||
.PHONY: clean
|
||||
all: ${BUILD_DIR}/${TARGET}
|
||||
|
||||
clean:
|
||||
$(RM) $(DELOBJ) $(DEP) $(APPNAME)
|
||||
rm -rf ${BUILD_DIR}/*
|
||||
|
||||
# Cleans only all files with the extension .d
|
||||
.PHONY: cleandep
|
||||
cleandep:
|
||||
$(RM) $(DEP)
|
||||
distclean:
|
||||
rm -rf ${BUILD_DIR}
|
||||
|
||||
#################### Cleaning rules for Windows OS #####################
|
||||
# Cleans complete project
|
||||
.PHONY: cleanw
|
||||
cleanw:
|
||||
$(DEL) $(WDELOBJ) $(DEP) $(APPNAME)$(EXE)
|
||||
|
||||
# Cleans only all files with the extension .d
|
||||
.PHONY: cleandepw
|
||||
cleandepw:
|
||||
$(DEL) $(DEP)
|
||||
include $(MAKE_HOME)/compile.mk
|
||||
|
||||
Reference in New Issue
Block a user