revise Makefile to adapt the Shixy environment on Ubuntu 14

main
rensichao 1 year ago
parent 4172078d7b
commit 7f60eebbe0

@ -19,9 +19,9 @@ VER := $(strip $(VER))
MY_CFLAGS = -fmessage-length=0 MY_CFLAGS = -fmessage-length=0
ifeq ($(PLAT),x86) ifeq ($(PLAT),x86)
MY_LIBS = -lpthread -L../lib -lrt -ldl -lscl_shm -lm -lgo MY_LIBS = -lpthread -L../lib -lrt -ldl -lscl_shm -lm -lgo -lmodbus
else else
MY_LIBS = -L../lib -lpthread -lrt -ldl -lscl_shm -lm -lgo MY_LIBS = -L../lib -lpthread -lrt -ldl -lscl_shm -lm -lgo -lmodbus
endif endif
# The pre-processor options used by the cpp (man cpp for more). # The pre-processor options used by the cpp (man cpp for more).
@ -53,19 +53,19 @@ HDREXTS = .h .H .hh .hpp .HPP .h++ .hxx .hp
# Users can override those variables from the command line. # Users can override those variables from the command line.
ifeq ($(VER),debug) ifeq ($(VER),debug)
ifeq ($(TYPE),so) ifeq ($(TYPE),so)
CFLAGS = -ggdb -pipe -O0 -fPIC -I. -I../inc CFLAGS = -ggdb -pipe -O0 -fPIC -I./EasyLogger/inc -I../inc
CXXFLAGS= -ggdb -pipe -O0 -fPIC -I. -I../inc CXXFLAGS= -ggdb -pipe -O0 -fPIC -I./EasyLogger/inc -I../inc
else else
CFLAGS = -ggdb -pipe -O0 -I. -I../inc CFLAGS = -ggdb -pipe -O0 -I./EasyLogger/inc -I../inc
CXXFLAGS= -ggdb -pipe -O0 -I. -I../inc CXXFLAGS= -ggdb -pipe -O0 -I./EasyLogger/inc -I../inc
endif endif
else else
ifeq ($(TYPE),so) ifeq ($(TYPE),so)
CFLAGS = -O2 -pipe -fPIC -I. -I../inc CFLAGS = -O2 -pipe -fPIC -I./EasyLogger/inc -I../inc
CXXFLAGS= -O2 -pipe -fPIC -I. -I../inc CXXFLAGS= -O2 -pipe -fPIC -I./EasyLogger/inc -I../inc
else else
CFLAGS = -O2 -pipe -I. -I../inc CFLAGS = -O2 -pipe -I./EasyLogger/inc -I../inc
CXXFLAGS= -O2 -pipe -I. -I../inc CXXFLAGS= -O2 -pipe -I./EasyLogger/inc -I../inc
endif endif
endif endif
@ -73,14 +73,14 @@ endif
ifeq ($(PLAT),x86) ifeq ($(PLAT),x86)
CC = gcc CC = gcc
else else
CC = arm-linux-gnueabihf-gcc CC = /root/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
endif endif
# The C++ program compiler. # The C++ program compiler.
ifeq ($(PLAT),x86) ifeq ($(PLAT),x86)
CXX = g++ CXX = g++
else else
CXX = arm-linux-gnueabihf-g++ CXX = /root/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
endif endif
# Un-comment the following line to compile C programs as C++ ones. # Un-comment the following line to compile C programs as C++ ones.
@ -89,7 +89,7 @@ endif
ifeq ($(PLAT),x86) ifeq ($(PLAT),x86)
STRIP = strip STRIP = strip
else else
STRIP = arm-none-linux-gnueabi-strip STRIP = /root/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip
endif endif
# The command used to delete file. # The command used to delete file.
@ -114,7 +114,7 @@ ifeq ($(PROGRAM),)
endif endif
endif endif
ifeq ($(SRCDIRS),) ifeq ($(SRCDIRS),)
SRCDIRS = . SRCDIRS = . ./EasyLogger/src
endif endif
SOURCES = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS)))) SOURCES = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS))))
HEADERS = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(HDREXTS)))) HEADERS = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(HDREXTS))))

Loading…
Cancel
Save