qpc/ports/win32-qv/Makefile

224 lines
5.8 KiB
Makefile
Raw Normal View History

2012-08-14 18:07:04 -04:00
##############################################################################
2015-09-04 12:08:22 -04:00
# Product: Makefile for QP/C port to Win32 API, MinGW toolset
2016-05-05 12:19:00 -04:00
# Last Updated for Version: 5.6.4
# Date of the Last Update: 2016-05-02
2012-08-14 18:07:04 -04:00
#
# Q u a n t u m L e a P s
# ---------------------------
# innovating embedded systems
#
2014-04-06 11:43:13 -04:00
# Copyright (C) Quantum Leaps, LLC. All rights reserved.
2012-08-14 18:07:04 -04:00
#
2012-12-10 16:00:27 -05:00
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
2012-12-10 16:00:27 -05:00
# (at your option) any later version.
2012-08-14 18:07:04 -04:00
#
2012-12-10 16:00:27 -05:00
# Alternatively, this program may be distributed and modified under the
2012-08-14 18:07:04 -04:00
# terms of Quantum Leaps commercial licenses, which expressly supersede
2012-12-10 16:00:27 -05:00
# the GNU General Public License and are specifically designed for
# licensees interested in retaining the proprietary status of their code.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2012-08-14 18:07:04 -04:00
#
# Contact information:
2016-05-05 12:19:00 -04:00
# http://www.state-machine.com
# mailto:info@state-machine.com
2012-08-14 18:07:04 -04:00
##############################################################################
# examples of invoking this Makefile:
# building configurations: Debug (default), Release, and Spy
2015-04-28 13:45:35 -04:00
# make
# make CONF=rel
# make CONF=spy
2012-08-14 18:07:04 -04:00
#
# cleaning configurations: Debug (default), Release, and Spy
2015-04-28 13:45:35 -04:00
# make clean
# make CONF=rel clean
# make CONF=spy clean
#
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the Qtools collection for Windows, see:
# http://sourceforge.net/projects/qpc/files/Qtools/
2012-08-14 18:07:04 -04:00
#
#-----------------------------------------------------------------------------
2015-04-28 13:45:35 -04:00
# project name
2012-08-14 18:07:04 -04:00
#
2015-04-28 13:45:35 -04:00
PROJECT := qp
2012-08-14 18:07:04 -04:00
#-----------------------------------------------------------------------------
2015-04-28 13:45:35 -04:00
# project directories
2012-08-14 18:07:04 -04:00
#
2015-04-28 13:45:35 -04:00
# location of the QP/C framework
2015-06-04 22:47:13 -04:00
QPC := ../..
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
# QP port used in this project
2015-06-04 22:47:13 -04:00
QP_PORT_DIR := .
2012-08-14 18:07:04 -04:00
2013-09-23 14:34:35 -04:00
2015-04-28 13:45:35 -04:00
# list of all source directories used by this project
VPATH = \
$(QPC)/source \
$(QP_PORT_DIR)
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
# list of all include directories needed by this project
INCLUDES = \
-I$(QPC)/include \
-I$(QPC)/source \
-I$(QP_PORT_DIR)
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
#-----------------------------------------------------------------------------
# files
#
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
# C source files
C_SRCS := \
qep_hsm.c \
qep_msm.c \
qf_act.c \
qf_actq.c \
qf_defer.c \
qf_dyn.c \
qf_mem.c \
qf_ps.c \
qf_qact.c \
qf_qeq.c \
qf_qmact.c \
qf_time.c \
2016-05-05 12:19:00 -04:00
qwin_gui.c \
2015-04-28 13:45:35 -04:00
qf_port.c
C_QS_SRCS := \
qs.c \
2015-09-04 12:08:22 -04:00
qs_rx.c \
2015-04-28 13:45:35 -04:00
qs_fp.c \
qs_64bit.c
# C++ source files
CPP_SRCS :=
# defines
2016-05-05 12:19:00 -04:00
DEFINES := -DQWIN_GUI
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
#-----------------------------------------------------------------------------
# MinGW toolset (NOTE: assumed to be on your PATH)
#
# NOTE:
# MinGW toolset is included in the Qtools collection for Windows, see:
# http://sourceforge.net/projects/qpc/files/Qtools/
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
CC := gcc
LIB := ar
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
##############################################################################
# Typically, you should not need to change anything below this line
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
# basic utilities (included in Qtools for Windows), see:
# http://sourceforge.net/projects/qpc/files/Qtools
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
MKDIR := mkdir
RM := rm
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
#-----------------------------------------------------------------------------
# build options for various configurations
#
2013-09-23 14:34:35 -04:00
2015-04-28 13:45:35 -04:00
LIBFLAGS := rs
2012-08-14 18:07:04 -04:00
2015-06-04 22:47:13 -04:00
ifeq (rel, $(CONF)) # Release configuration .................................
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
BIN_DIR = rel
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
# gcc options
2015-06-04 22:47:13 -04:00
CFLAGS = -c -ffunction-sections -fdata-sections \
-Os $(INCLUDES) $(DEFINES) -Wall -W
2012-08-14 18:07:04 -04:00
2015-09-04 12:08:22 -04:00
CPPFLAGS = -c -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections \
-Os $(INCLUDES) $(DEFINES) -Wall -W
2015-04-28 13:45:35 -04:00
else ifeq (spy, $(CONF)) # Spy configuration ................................
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
BIN_DIR = spy
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
# gcc options
2015-06-04 22:47:13 -04:00
CFLAGS = -c -g -ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -Wall -W -DQ_SPY
2012-08-14 18:07:04 -04:00
2015-09-04 12:08:22 -04:00
CPPFLAGS = -c -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -Wall -W -DQ_SPY
2015-04-28 13:45:35 -04:00
# add the QS sources...
C_SRCS += $(C_QS_SRCS)
2012-08-14 18:07:04 -04:00
2015-06-04 22:47:13 -04:00
else # default Debug configuration .........................................
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
BIN_DIR = dbg
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
# gcc options
2015-06-04 22:47:13 -04:00
CFLAGS = -c -g -ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -Wall -W
2012-08-14 18:07:04 -04:00
2015-09-04 12:08:22 -04:00
CPPFLAGS = -c -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections \
-O $(INCLUDES) $(DEFINES) -Wall -W
2015-04-28 13:45:35 -04:00
endif
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
C_OBJS := $(patsubst %.c,%.o, $(notdir $(C_SRCS)))
CPP_OBJS := $(patsubst %.cpp,%.o,$(notdir $(CPP_SRCS)))
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
TARGET_LIB := $(BIN_DIR)/lib$(PROJECT).a
C_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(C_OBJS))
CPP_OBJS_EXT := $(addprefix $(BIN_DIR)/, $(CPP_OBJS))
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
# create $(BIN_DIR) if it does not exist
ifeq ("$(wildcard $(BIN_DIR))","")
$(shell $(MKDIR) $(BIN_DIR))
endif
2013-09-23 14:34:35 -04:00
2015-04-28 13:45:35 -04:00
#-----------------------------------------------------------------------------
# rules
#
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
all: $(TARGET_LIB)
-$(RM) $(BIN_DIR)/*.o
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
$(TARGET_LIB) : $(ASM_OBJS_EXT) $(C_OBJS_EXT) $(CPP_OBJS_EXT)
$(LIB) $(LIBFLAGS) $@ $^
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
$(BIN_DIR)/%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
$(BIN_DIR)/%.o : %.cpp
$(CPP) $(CPPFLAGS) -c $< -o $@
2012-08-14 18:07:04 -04:00
2015-04-28 13:45:35 -04:00
#-----------------------------------------------------------------------------
# the clean target
#
2012-08-14 18:07:04 -04:00
.PHONY : clean
clean:
2015-04-28 13:45:35 -04:00
-$(RM) $(BIN_DIR)/*.o $(TARGET_LIB)
#-----------------------------------------------------------------------------
# the show target for debugging
#
show:
@echo PROJECT = $(PROJECT)
@echo CONF = $(CONF)
@echo TARGET_LIB = $(TARGET_LIB)
@echo C_SRCS = $(C_SRCS)
@echo CPP_SRCS = $(CPP_SRCS)
@echo C_OBJS_EXT = $(C_OBJS_EXT)
@echo C_DEPS_EXT = $(C_DEPS_EXT)
2015-09-04 12:08:22 -04:00
@echo CPP_OBJS_EXT = $(CPP_OBJS_EXT)
2015-04-28 13:45:35 -04:00
@echo CPP_DEPS_EXT = $(CPP_DEPS_EXT)