Commit 7e904c5d authored by maitre's avatar maitre

Using static library (exe could be placed in /usr/bin), std_mo (dual

objective)
parent a49c8888
......@@ -23,6 +23,12 @@ Centre de Math
#define DREAM 3
#define CUDA 4
#define STD 5
#define STD_FLAVOR_SO 0
#define STD_FLAVOR_MO 1
#define CUDA_FLAVOR_SO 0
#define CUDA_FLAVOR_MO 0
#define UNIX 1
#define WINDOWS 2
#define UNKNOWN_OS 3
......@@ -46,6 +52,7 @@ extern char sMIG_SEL[], sMIGRATOR[], sIMMIG_SEL[],sMIG_TARGET_SELECTOR[];
extern int nWARNINGS, nERRORS;
extern int TARGET, OPERATING_SYSTEM;
extern int TARGET_FLAVOR;
// Prototypes
extern int mystricmp(char *, char *);
......@@ -1820,7 +1820,10 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
} }
if (TARGET==STD){
strcat(sTemp,"STD.tpl");
if(TARGET_FLAVOR == STD_FLAVOR_SO)
strcat(sTemp,"STD.tpl");
else
strcat(sTemp,"STD_MO.tpl");
if (!(yyin = fpTemplateFile = fopen(sTemp, "r"))){
fprintf(stderr,"\n*** Could not open %s.\n",sTemp);
fprintf(stderr,"*** Please modify the EZ_PATH environment variable.\n");
......
......@@ -24,7 +24,7 @@ char sLOWER_CASE_PROJECT_NAME[1000];
char sEZ_FILE_NAME[1000];
char sEO_DIR[1000];
char sEZ_PATH[1000];
int TARGET;
int TARGET,TARGET_FLAVOR;
int OPERATING_SYSTEM;
int nWARNINGS=0;
int nERRORS=0;
......@@ -1327,7 +1327,14 @@ int main(int argc, char *argv[]){
else if (!mystricmp(sTemp,"galib")) TARGET=GALIB;
else if (!mystricmp(sTemp,"dream")) TARGET=DREAM;
else if (!mystricmp(sTemp,"cuda")) TARGET=CUDA;
else if (!mystricmp(sTemp,"std")) TARGET=STD;
else if (!mystricmp(sTemp,"std")) {
TARGET=STD;
TARGET_FLAVOR = STD_FLAVOR_SO;
}
else if (!mystricmp(sTemp,"std_mo")) {
TARGET=STD;
TARGET_FLAVOR = STD_FLAVOR_MO;
}
else if (!mystricmp(sTemp,"v")) bVERBOSE=true;
else if (!mystricmp(sTemp,"path")) {
if (argv[++nParamNb][0]=='"') {
......
......@@ -10,6 +10,11 @@ yycunput.o yycuoflw.o yycwipe.o yycwork.o yycwrap.o
CPPC = g++
CPPFLAGS = -Iinclude/
LIB_NAME=libalex.so
STATIC_LIB_NAME = libalex.a
$(STATIC_LIB_NAME): $(OBJS)
ar -r $@ $(OBJS) && ranlib $@
$(LIB_NAME): $(OBJS)
$(CPPC) -shared -o $@ $^
......
......@@ -4,12 +4,41 @@ CPPC = g++
LDFLAGS =
$(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.so
$(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.a
$(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
#
# Congratulations ! It looks like you compiled EASEA successfully.
#
# Generated files depend on libboost-program-options,
# be sure that the development version of this library
# is installed on you system :
# For example, on ubuntu :
# sudo apt-get install libboost-program-options-dev
#
# Easea could be moved to a bin directory or included in the PATH
# as long as users have defined a EZ_PATH environment variable
# pointing to the tpl/ directory.
# To do this temporarly type :
# export EZ_PATH=`pwd`/tpl/
# Or define EZ_PATH in your bashrc file (for bash users) :
# For example :
# export EZ_PATH=/path/to/easea/directory/tpl/
#
# Otherwise you can use easea from this directory by typing :
# For example :
# ./easea examples/weierstrass/weierstrass.ez
# Go to the taget directory and type make
#
# Thanks for using EASEA.
#
# $(EXEC):EaseaSym.o EaseaParse.o EaseaLex.o alexyacc/libalex.so
# $(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
$(EXEC)_bin:EaseaSym.o EaseaParse.o EaseaLex.o
$(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ -lalex
# $(EXEC)_bin:EaseaSym.o EaseaParse.o EaseaLex.o
# $(CPPC) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ -lalex
......@@ -23,6 +52,10 @@ EaseaParse.o: EaseaParse.cpp EaseaLex.cpp
alexyacc/libalex.so:alexyacc/*.cpp
cd alexyacc && make libalex.so
alexyacc/libalex.a:alexyacc/*.cpp
cd alexyacc && make libalex.a
clean:
rm -f *.o $(EXEC) $(EXEC)_bin
cd alexyacc && make clean
......
This diff is collapsed.
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