mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 02:59:54 +00:00
On install, merge janetconf.h into janet.h
This results in a cleaner amalgmated build
This commit is contained in:
parent
306bdee673
commit
2dc04d2957
@ -2,6 +2,7 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## Unreleased - ???
|
## Unreleased - ???
|
||||||
|
- During installation and release, merge janetconf.h into janet.h for easier install.
|
||||||
- Add `upscope` special form.
|
- Add `upscope` special form.
|
||||||
- `os/execute` and `os/spawn` can take streams for redirecting IO.
|
- `os/execute` and `os/spawn` can take streams for redirecting IO.
|
||||||
- Add `;parser` and `:read` parameters to `run-context`.
|
- Add `;parser` and `:read` parameters to `run-context`.
|
||||||
|
16
Makefile
16
Makefile
@ -67,7 +67,7 @@ ifeq ($(UNAME), Haiku)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
$(shell mkdir -p build/core build/mainclient build/webclient build/boot)
|
$(shell mkdir -p build/core build/mainclient build/webclient build/boot)
|
||||||
all: $(JANET_TARGET) $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY)
|
all: $(JANET_TARGET) $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) build/janet.h
|
||||||
|
|
||||||
######################
|
######################
|
||||||
##### Name Files #####
|
##### Name Files #####
|
||||||
@ -162,16 +162,16 @@ SONAME=libjanet.so.1.12
|
|||||||
build/shell.c: src/mainclient/shell.c
|
build/shell.c: src/mainclient/shell.c
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
||||||
build/janet.h: src/include/janet.h
|
build/janet.h: $(JANET_TARGET) src/include/janet.h src/conf/janetconf.h
|
||||||
cp $< $@
|
./$(JANET_TARGET) tools/patch-header.janet src/include/janet.h src/conf/janetconf.h $@
|
||||||
|
|
||||||
build/janetconf.h: src/conf/janetconf.h
|
build/janetconf.h: src/conf/janetconf.h
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
||||||
build/janet.o: build/janet.c build/janet.h build/janetconf.h
|
build/janet.o: build/janet.c src/include/janet.h src/conf/janetconf.h
|
||||||
$(HOSTCC) $(BUILD_CFLAGS) -c $< -o $@ -I build
|
$(HOSTCC) $(BUILD_CFLAGS) -c $< -o $@ -I build
|
||||||
|
|
||||||
build/shell.o: build/shell.c build/janet.h build/janetconf.h
|
build/shell.o: build/shell.c src/include/janet.h src/conf/janetconf.h
|
||||||
$(HOSTCC) $(BUILD_CFLAGS) -c $< -o $@ -I build
|
$(HOSTCC) $(BUILD_CFLAGS) -c $< -o $@ -I build
|
||||||
|
|
||||||
$(JANET_TARGET): build/janet.o build/shell.o
|
$(JANET_TARGET): build/janet.o build/shell.o
|
||||||
@ -222,7 +222,7 @@ callgrind: $(JANET_TARGET)
|
|||||||
dist: build/janet-dist.tar.gz
|
dist: build/janet-dist.tar.gz
|
||||||
|
|
||||||
build/janet-%.tar.gz: $(JANET_TARGET) \
|
build/janet-%.tar.gz: $(JANET_TARGET) \
|
||||||
src/include/janet.h src/conf/janetconf.h \
|
build/janet.h \
|
||||||
jpm.1 janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) \
|
jpm.1 janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) \
|
||||||
build/doc.html README.md build/janet.c build/shell.c jpm
|
build/doc.html README.md build/janet.c build/shell.c jpm
|
||||||
$(eval JANET_DIST_DIR = "janet-$(shell basename $*)")
|
$(eval JANET_DIST_DIR = "janet-$(shell basename $*)")
|
||||||
@ -262,11 +262,11 @@ build/janet.pc: $(JANET_TARGET)
|
|||||||
echo 'Libs: -L$${libdir} -ljanet' >> $@
|
echo 'Libs: -L$${libdir} -ljanet' >> $@
|
||||||
echo 'Libs.private: $(CLIBS)' >> $@
|
echo 'Libs.private: $(CLIBS)' >> $@
|
||||||
|
|
||||||
install: $(JANET_TARGET) $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) build/janet.pc build/jpm
|
install: $(JANET_TARGET) $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) build/janet.pc build/jpm build/janet.h
|
||||||
mkdir -p '$(DESTDIR)$(BINDIR)'
|
mkdir -p '$(DESTDIR)$(BINDIR)'
|
||||||
cp $(JANET_TARGET) '$(DESTDIR)$(BINDIR)/janet'
|
cp $(JANET_TARGET) '$(DESTDIR)$(BINDIR)/janet'
|
||||||
mkdir -p '$(DESTDIR)$(INCLUDEDIR)/janet'
|
mkdir -p '$(DESTDIR)$(INCLUDEDIR)/janet'
|
||||||
cp -rf $(JANET_HEADERS) '$(DESTDIR)$(INCLUDEDIR)/janet'
|
cp -r build/janet.h '$(DESTDIR)$(INCLUDEDIR)/janet'
|
||||||
mkdir -p '$(DESTDIR)$(JANET_PATH)'
|
mkdir -p '$(DESTDIR)$(JANET_PATH)'
|
||||||
mkdir -p '$(DESTDIR)$(LIBDIR)'
|
mkdir -p '$(DESTDIR)$(LIBDIR)'
|
||||||
cp $(JANET_LIBRARY) '$(DESTDIR)$(LIBDIR)/libjanet.so.$(shell $(JANET_TARGET) -e '(print janet/version)')'
|
cp $(JANET_LIBRARY) '$(DESTDIR)$(LIBDIR)/libjanet.so.$(shell $(JANET_TARGET) -e '(print janet/version)')'
|
||||||
|
@ -35,9 +35,6 @@ artifacts:
|
|||||||
- name: janet.h
|
- name: janet.h
|
||||||
path: dist\janet.h
|
path: dist\janet.h
|
||||||
type: File
|
type: File
|
||||||
- name: janetconf.h
|
|
||||||
path: dist\janetconf.h
|
|
||||||
type: File
|
|
||||||
- name: shell.c
|
- name: shell.c
|
||||||
path: dist\shell.c
|
path: dist\shell.c
|
||||||
type: File
|
type: File
|
||||||
|
@ -113,8 +113,8 @@ copy README.md dist\README.md
|
|||||||
copy janet.lib dist\janet.lib
|
copy janet.lib dist\janet.lib
|
||||||
copy janet.exp dist\janet.exp
|
copy janet.exp dist\janet.exp
|
||||||
|
|
||||||
copy src\include\janet.h dist\janet.h
|
janet.exe tools\patch-header.janet src\include\janet.h src\conf\janetconf.h build\janet.h
|
||||||
copy src\conf\janetconf.h dist\janetconf.h
|
copy build\janet.h dist\janet.h
|
||||||
copy build\libjanet.lib dist\libjanet.lib
|
copy build\libjanet.lib dist\libjanet.lib
|
||||||
|
|
||||||
copy .\jpm dist\jpm
|
copy .\jpm dist\jpm
|
||||||
|
@ -248,8 +248,14 @@ pkg.generate(libjanet,
|
|||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
install_man('janet.1')
|
install_man('janet.1')
|
||||||
install_headers(['src/include/janet.h', jconf], subdir: 'janet')
|
|
||||||
install_data(sources : ['tools/.keep'], install_dir : join_paths(get_option('libdir'), 'janet'))
|
install_data(sources : ['tools/.keep'], install_dir : join_paths(get_option('libdir'), 'janet'))
|
||||||
|
patched_janet = custom_target('patched-janeth',
|
||||||
|
input : ['tools/patch-header.janet', 'src/include/janet.h', jconf],
|
||||||
|
install : true,
|
||||||
|
install_dir : join_paths(get_option('includedir'), 'janet'),
|
||||||
|
build_by_default : true,
|
||||||
|
output : ['janet.h'],
|
||||||
|
command : [janet_nativeclient, '@INPUT@', '@OUTPUT@'])
|
||||||
if get_option('peg') and not get_option('reduced_os') and get_option('processes')
|
if get_option('peg') and not get_option('reduced_os') and get_option('processes')
|
||||||
install_man('jpm.1')
|
install_man('jpm.1')
|
||||||
patched_jpm = custom_target('patched-jpm',
|
patched_jpm = custom_target('patched-jpm',
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "janetconf.h"
|
||||||
|
|
||||||
#ifndef JANET_H_defined
|
#ifndef JANET_H_defined
|
||||||
#define JANET_H_defined
|
#define JANET_H_defined
|
||||||
|
|
||||||
@ -35,8 +37,6 @@ extern "C" {
|
|||||||
|
|
||||||
/***** START SECTION CONFIG *****/
|
/***** START SECTION CONFIG *****/
|
||||||
|
|
||||||
#include "janetconf.h"
|
|
||||||
|
|
||||||
#ifndef JANET_VERSION
|
#ifndef JANET_VERSION
|
||||||
#define JANET_VERSION "latest"
|
#define JANET_VERSION "latest"
|
||||||
#endif
|
#endif
|
||||||
|
@ -126,9 +126,6 @@
|
|||||||
<File Source="dist\janet.h"/>
|
<File Source="dist\janet.h"/>
|
||||||
<RemoveFolder Id="RemoveCDir" On="uninstall" />
|
<RemoveFolder Id="RemoveCDir" On="uninstall" />
|
||||||
</Component>
|
</Component>
|
||||||
<Component Directory="CDir">
|
|
||||||
<File Source="dist\janetconf.h"/>
|
|
||||||
</Component>
|
|
||||||
<Component Directory="CDir">
|
<Component Directory="CDir">
|
||||||
<File Source="dist\janet.lib"/>
|
<File Source="dist\janet.lib"/>
|
||||||
</Component>
|
</Component>
|
||||||
|
12
tools/patch-header.janet
Normal file
12
tools/patch-header.janet
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Patch janet.h
|
||||||
|
|
||||||
|
(def [_ janeth janetconf output] (dyn :args))
|
||||||
|
|
||||||
|
(def- replace-peg
|
||||||
|
(peg/compile
|
||||||
|
~(% (* '(to `#include "janetconf.h"`)
|
||||||
|
(constant ,(slurp janetconf))
|
||||||
|
(thru `#include "janetconf.h"`)
|
||||||
|
'(any 1)))))
|
||||||
|
|
||||||
|
(spit output (first (peg/match replace-peg (slurp janeth))))
|
Loading…
Reference in New Issue
Block a user