Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Fix build folder (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
dchassin authored Apr 30, 2022
1 parent 2a9c869 commit c19240e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion converters/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# INPUT CONVERTERS
#

python_requirements += converters/requirements.txt
python_requirements += $(top_srcdir)/converters/requirements.txt

# csv -> glm
dist_pkgdata_DATA += converters/csv-ami2glm-ceus.py
Expand Down
4 changes: 2 additions & 2 deletions python/Makefile.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PYTHONVERSION=$(shell python3 $(top_srcdir)/python/setup.py --version)

$(top_srcdir)/python/dist/gridlabd-$(PYTHONVERSION).tar.gz: source/build.h
$(top_srcdir)/python/dist/gridlabd-$(PYTHONVERSION).tar.gz: $(top_srcdir)/source/build.h
@echo "building $@"
@rm -f $(top_srcdir)/python/dist/gridlabd-*.{whl,tar.gz}
@python3 -m pip install build 1>/dev/null
@( export SRCDIR=$(realpath $(top_srcdir)) ; python3 -m build $(top_srcdir)/python 1>/dev/null )
@( export SRCDIR=$(realpath $(top_srcdir)) ; export BLDDIR=$(shell pwd); python3 -m build $(top_srcdir)/python 1>/dev/null )

python-install: $(top_srcdir)/python/dist/gridlabd-$(PYTHONVERSION).tar.gz
@echo "installing $@"
Expand Down
6 changes: 4 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
srcdir = os.path.realpath(sys.argv[0]).replace("/python/setup.py","")
else:
srcdir = os.path.realpath(srcdir)

blddir = os.getenv('BLDDIR')
if not blddir:
blddir = os.getcwd()
try:
from compile_options import *
except:
Expand All @@ -44,7 +46,7 @@
compile_options = None
if not compile_options :
compile_options=['-Wall','-O3','-g']
compile_options.extend(['-I%s/source'%srcdir,'-Isource','-Isource/rt',"-fPIC","-DHAVE_CONFIG_H","-DHAVE_PYTHON"])
compile_options.extend(['-I%s/source'%srcdir,'-I%s/python'%srcdir,'-I%s/runtime'%srcdir,'-I%s/source'%blddir,"-fPIC","-DHAVE_CONFIG_H","-DHAVE_PYTHON"])

from distutils.core import setup, Extension
gridlabd = Extension('gridlabd',
Expand Down
10 changes: 5 additions & 5 deletions source/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ gridlabd_bin_LDADD += -ldl -lcurl

bin_SCRIPTS += source/gridlabd

gridlabd_bin_SOURCES += source/build.h
BUILT_SOURCES += source/build.h
CLEANFILES += source/build.h origin.txt
gridlabd_bin_SOURCES += $(top_srcdir)/source/build.h
BUILT_SOURCES += $(top_srcdir)/source/build.h
CLEANFILES += $(top_srcdir)/source/build.h origin.txt

pkginclude_HEADERS =
pkginclude_HEADERS += source/build.h
pkginclude_HEADERS += $(top_srcdir)/source/build.h
pkginclude_HEADERS += source/class.h
pkginclude_HEADERS += source/complex.h
pkginclude_HEADERS += source/debug.h
Expand All @@ -117,7 +117,7 @@ gridlabd_DATA = origin.txt
# @autom4te -l m4sh $< > $@
# @echo "$@ updated, please run 'make reconfigure && make TARGET' again" && false

source/build.h: buildnum
$(top_srcdir)/source/build.h: buildnum

buildnum: utilities/build_number
@/bin/bash -c "$(top_srcdir)/utilities/build_number"
Expand Down
2 changes: 1 addition & 1 deletion subcommands/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ bin_SCRIPTS += subcommands/gridlabd-validate
bin_SCRIPTS += subcommands/gridlabd-version
bin_SCRIPTS += subcommands/gridlabd-weather

python_requirements += subcommands/requirements.txt
python_requirements += $(top_srcdir)/subcommands/requirements.txt

0 comments on commit c19240e

Please sign in to comment.