Skip to content

Commit

Permalink
fixes not portable -C flag used in the Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhahsler committed May 14, 2021
1 parent a8ff2be commit bb37797
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 84 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pomdp
Title: Solver for Partially Observable Markov Decision Processes (POMDP)
Version: 0.99.1
Date: 2021-05-13
Version: 0.99.2
Date: 2021-05-14
Authors@R:
c(person(given = "Michael",
family = "Hahsler",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# pomdp 0.99.2 (05/14/2021)

## Bugfix
* Removed nonportable flag -C from Makefile.

# pomdp 0.99.1 (05/13/2021)

## New Features
Expand Down
28 changes: 12 additions & 16 deletions src/pomdp-solve/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,24 @@ OBJ = alpha.o belief.o cmd-line.o common.o cross-sum.o enumeration.o \
associative-array.o command-line.o config-file.o program-options.o main.o

SUBDIRS = mdp lp-solve laspack

.PHONY: clean
SUBLIBS = $(SUBDIRS:=.a)

all: pomdp-solve

mdp/libmdp.a:
(cd mdp && CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE))

lp-solve/liblp-solve.a:
(cd lp-solve && CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE))

laspack/liblaspack.a:
(cd laspack && CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE))

pomdp-solve: $(OBJ) mdp/libmdp.a lp-solve/liblp-solve.a laspack/liblaspack.a
pomdp-solve: sublibs $(OBJ)
$(CC) $(CFLAGS) $(INCLUDE) $(OBJ) -o pomdp-solve $(MY_LIBS)

clean:
sublibs:
@for d in $(SUBDIRS); do \
(cd $${d} && CXX="$(CXX)" CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" $(MAKE)) || exit 1; \
done

clean: subclean
@rm -f *.o
@rm -f pomdp-solve
@rm -f pomdp-solve.exe
for dir in $(SUBDIRS); do \
$(MAKE) -C $${dir} clean; \
done

subclean:
@for d in $(SUBDIRS); do \
(cd $${d} && $(MAKE) clean) || exit 1; \
done
27 changes: 14 additions & 13 deletions src/pomdp-solve/laspack/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
LIB = ./liblaspack.a
OBJ = eigenval.o matrix.o qmatrix.o errhandl.o mlsolv.o rtc.o factor.o operats.o vector.o itersolv.o precond.o

default: $(LIB)

$(LIB): $(OBJ)
$(AR) -rcs $(LIB) $(OBJ)

.PHONY: clean

clean:
@-rm -rf .libs _libs $(LIB)
@-rm -f *.o
LIB = ./liblaspack.a
OBJ = eigenval.o matrix.o qmatrix.o errhandl.o mlsolv.o rtc.o factor.o operats.o \
vector.o itersolv.o precond.o

default: $(LIB)

$(LIB): $(OBJ)
$(AR) -rcs $(LIB) $(OBJ)

clean:
@-rm -rf .libs _libs $(LIB)
@-rm -f *.o

.PHONY: clean
50 changes: 25 additions & 25 deletions src/pomdp-solve/lp-solve/Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
LIB = ./liblp-solve.a
OBJ = y.tab.o lex.yy.o debug.o hash.o lpkit.o presolve.o read.o solve.o

default: $(LIB)

# don't check the files so Windows does not try to rebuild them
#lex.yy.c: lex.l y.tab.c
lex.yy.c:
lex lex.l

#y.tab.c: lp.y
y.tab.c:
yacc -d lp.y

$(LIB): $(OBJ)
$(AR) -rcs $(LIB) $(OBJ)

.PHONY: clean deepclean

clean:
@-rm -rf .libs _libs $(LIB)
@-rm -f *.o

deepclean: clean
@-rm -f y.tab.c lex.yy.c
LIB = ./liblp-solve.a
OBJ = y.tab.o lex.yy.o debug.o hash.o lpkit.o presolve.o read.o solve.o

default: $(LIB)

# don't check the files so Windows does not try to rebuild them
#lex.yy.c: lex.l y.tab.c
lex.yy.c:
lex lex.l

#y.tab.c: lp.y
y.tab.c:
yacc -d lp.y

$(LIB): $(OBJ)
$(AR) -rcs $(LIB) $(OBJ)

clean:
@-rm -rf .libs _libs $(LIB)
@-rm -f *.o

deepclean: clean
@-rm -f y.tab.c lex.yy.c

.PHONY: clean deepclean
56 changes: 28 additions & 28 deletions src/pomdp-solve/mdp/Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
LIB = libmdp.a
OBJ = parser.o scanner.o imm-reward.o parse_err.o sparse-matrix.o mdp.o parse_hash.o

default: $(LIB)

# don't check sources so Windows does not try to rebuild
#scanner.c: scanner.l
scanner.c:
lex -P yymdp scanner.l
mv lex.yymdp.c scanner.c

#parser.c parser.h: parser.y
parser.c parser.h:
yacc -p yymdp -d parser.y
mv y.tab.c parser.c
mv y.tab.h parser.h

$(LIB): $(OBJ)
$(AR) -rcs $(LIB) $(OBJ)

.PHONY: clean deepclean

clean:
@-rm -rf .libs _libs $(LIB)
@-rm -f *.o

deepclean: clean
@-rm -f scanner.c parser.c parser.h
LIB = libmdp.a
OBJ = parser.o scanner.o imm-reward.o parse_err.o sparse-matrix.o mdp.o parse_hash.o

default: $(LIB)

# don't check sources so Windows does not try to rebuild
#scanner.c: scanner.l
scanner.c:
lex -P yymdp scanner.l
mv lex.yymdp.c scanner.c

#parser.c parser.h: parser.y
parser.c parser.h:
yacc -p yymdp -d parser.y
mv y.tab.c parser.c
mv y.tab.h parser.h

$(LIB): $(OBJ)
$(AR) -rcs $(LIB) $(OBJ)

clean:
@-rm -rf .libs _libs $(LIB)
@-rm -f *.o

deepclean: clean
@-rm -f scanner.c parser.c parser.h

.PHONY: clean deepclean

0 comments on commit bb37797

Please sign in to comment.