Commit 98f0a40f authored by Frédéric Pétrot's avatar Frédéric Pétrot
Browse files

Update Makefile.common

parent 74181fec
......@@ -6,32 +6,31 @@ SHELL = /bin/sh
AT = @
ifndef SYSTEMCROOT
$(error Please set environment variable SYSTEMCROOT)
SYSTEMCROOT = /matieres/5MMMTSP/cours-tlm/systemc-2.3.3
$(warning using default value for environment variable SYSTEMCROOT: $(SYSTEMCROOT))
endif
SYSTEMC = $(SYSTEMCROOT)
ifndef ENSITLM
ENSITLM = $(ROOT)/ensitlm/
ENSITLM = $(ROOT)/ensitlm
endif
ENSITLM_LIB=$(ENSITLM)/libensitlm.a
CLANG_FORMAT=clang-format-3.7
CLANG_FORMAT=clang-format
ifdef WITH_SDL
#ifeq ($(strip $(shell which sdl-config)),)
# ifeq ($(strip $(shell which sdl2-config)),)
# $(error SDL library not found)
# else
# SDLCFG := sdl2-config
# endif
#else
# SDLCFG := sdl-config
#endif
#SDLLIB = $(shell ${SDLCFG} --libs)
#SDLCC = $(shell ${SDLCFG} --cflags)
SDLLIB = $(shell sdl2-config --libs)
SDLCC = $(shell sdl2-config --cflags)
ifeq ($(strip $(shell which sdl-config)),)
ifeq ($(strip $(shell which sdl2-config)),)
$(error SDL library not found)
else
SDLCFG := sdl2-config
endif
else
SDLCFG := sdl-config
endif
SDLLIB = $(shell ${SDLCFG} --libs)
SDLCC = $(shell ${SDLCFG} --cflags)
else
SDLLIB =
SDSCC =
......@@ -45,7 +44,7 @@ CXX = g++
CPPFLAGS = -I$(SYSTEMC)/include
CPPFLAGS += -I$(ENSITLM) $(SDLCC)
CPPFLAGS += -MMD -MP -MF $(basename $@).d
CXXFLAGS = -O3 -g -Wall -Wextra -Winvalid-pch -Wno-unused-parameter #--std=gnu++11
CXXFLAGS = -O3 -g -Wall -Wextra -Winvalid-pch -Wno-unused-parameter -std=c++17
# Used when using SDL, hence precompiled header use it, hence we have
# to use it everywhere if we want PCH support:
CXXFLAGS += -D_GNU_SOURCE=1 -D_REENTRANT
......@@ -87,7 +86,7 @@ $(ENSITLM_LIB):
%.a: $(OBJS)
@echo "[$(MODULE)] creating static lib $@..."
$(AT)ar cr $@ $^
$(AT)ar cru $@ $^
$(AT)ranlib $@
%.gch: % $(filter-out %.d, $(MAKEFILE_LIST))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment