- 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 @@
|
|||||||
########################################################################
|
MAKE_HOME := /home/jens/work/software/make
|
||||||
####################### Makefile Template ##############################
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
# Compiler settings - Can be customized.
|
CONFIG ?= debug
|
||||||
CC = g++
|
TARGET ?= main
|
||||||
CXXFLAGS = -std=c++11 -Wall
|
BUILD_DIR := ./build/${CONFIG}
|
||||||
LDFLAGS =
|
|
||||||
|
|
||||||
# Makefile settings - Can be customized.
|
include ./processor.mk
|
||||||
APPNAME = myapp
|
|
||||||
EXT = .cpp
|
|
||||||
SRCDIR = src
|
|
||||||
OBJDIR = obj
|
|
||||||
|
|
||||||
############## Do not change anything from here downwards! #############
|
CXX_SRCS += test/main.cpp test/test01.cpp test/test02.cpp test/TestBlock.cpp test/NullSource.cpp test/NullSink.cpp
|
||||||
SRC = $(wildcard $(SRCDIR)/*$(EXT))
|
LIBS := -lstdc++ -lm -larmadillo
|
||||||
OBJ = $(SRC:$(SRCDIR)/%$(EXT)=$(OBJDIR)/%.o)
|
DEFINES += -DPROCESSOR_BUFFER_USE_EXCEPTIONS
|
||||||
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)
|
|
||||||
|
|
||||||
########################################################################
|
SRCS := ${CXX_SRCS} ${GCC_SRCS}
|
||||||
####################### Targets beginning here #########################
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
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
|
.PHONY: clean
|
||||||
|
all: ${BUILD_DIR}/${TARGET}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(DELOBJ) $(DEP) $(APPNAME)
|
rm -rf ${BUILD_DIR}/*
|
||||||
|
|
||||||
# Cleans only all files with the extension .d
|
distclean:
|
||||||
.PHONY: cleandep
|
rm -rf ${BUILD_DIR}
|
||||||
cleandep:
|
|
||||||
$(RM) $(DEP)
|
|
||||||
|
|
||||||
#################### Cleaning rules for Windows OS #####################
|
|
||||||
# Cleans complete project
|
|
||||||
.PHONY: cleanw
|
|
||||||
cleanw:
|
|
||||||
$(DEL) $(WDELOBJ) $(DEP) $(APPNAME)$(EXE)
|
|
||||||
|
|
||||||
# Cleans only all files with the extension .d
|
include $(MAKE_HOME)/compile.mk
|
||||||
.PHONY: cleandepw
|
|
||||||
cleandepw:
|
|
||||||
$(DEL) $(DEP)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user