Commit Graph

135 Commits

Author SHA1 Message Date
ISSOtm
3fce9ed9a4 Have Wine shim explicitly require bash
I didn't know the substitution was Bash-only..!
2020-02-17 15:03:46 +01:00
ISSOtm
21ffcc74db Don't use echo -e for creating the Wine shim
Apparently that's not as portable as I expected.
2020-02-17 14:32:35 +01:00
ISSOtm
5fd38c5f67 Do not try to link libpng statically 2020-02-14 03:07:24 +01:00
ISSOtm
42faffe6f3 Make the Wine shims a separate target 2020-02-13 23:06:05 +01:00
ISSOtm
d0ec35628f Split section management into its own file 2020-02-10 03:34:58 +01:00
ISSOtm
1d78cd0f03 Axe the constexpr expression evaluator
This avoids redundancy between them (and also having to port fixes and features)
The error messages have been preserved through a string reporting mechanism
2020-02-10 02:51:48 +01:00
ISSOtm
fd32b2252f Define additional variable when doing make develop 2020-02-03 19:58:02 +01:00
ISSOtm
24f41ef897 Expose link def arrays to RGBASM 2020-02-03 15:19:48 +01:00
ISSOtm
9ccb71205a Remove stale clean line
Those files don't exist in RGBLINK's source anymore
2020-01-14 11:42:07 +01:00
ISSOtm
1534df0b3c Use minGW's pkg-config 2020-01-09 01:10:51 +01:00
ISSOtm
ece9177f5a Produce shims to run the test suite on Windows bins via Wine 2020-01-09 01:10:51 +01:00
ISSOtm
6d9399e3a0 Always update version
Implements https://github.com/rednex/rgbds/pull/378#issuecomment-569836686
2020-01-09 00:27:22 +01:00
ISSOtm
a290e19f46 Make make checkcodebase ignore extern/
That folder contains external code, and modifying it to conform to our
code style would make applying upstream patches, amongst others,
problematic. Therefore, skip checking it.
Ideally, the folder should also be excluded from `make checkpatch`,
but I haven't figured out a way to do that yet.
2019-12-03 23:09:07 +01:00
ISSOtm
92a2be62fe Remove lex rules from Makefile
Since the RGBLINK rewrite, there have been no .l files in the whole codebase
(RGBASM has the C file directly, for better and for worse)
Since flex isn't used anymore, it's a good idea to remove it from the Makefile
so people don't think it's a dependency.
2019-12-03 23:02:38 +01:00
ISSOtm
191ee4ba1f Add support for toggleable warnings 2019-11-18 20:45:21 +01:00
Eldred Habert
197f1e9b7b Merge pull request #444 from ISSOtm/fix_develop
Fix errors in `make develop`
2019-11-06 08:34:37 +01:00
ISSOtm
0649e6d65f Add long options 2019-11-06 00:48:41 +01:00
ISSOtm
0e24adcafd Rewrite RGBLINK entirely
The goal was to improve readability, but along the way a few things were
gained.
- Sorted sym and map files
- Infrastructure for supporting multiple .o versions
- Valgrind-proof, as far as my testing goes anyways
- Improved verbosity messages
- Added error checking
- Performance improvements, see end of commit message

The readability improvement was spurred while trying to make sense of the
old code while trying to implement features such as sorted sym and map
files.
I also did my best to remove hardcoded logic, such that modifications
should be doable; for example, "RAM loading" sections, which are linked
against a different location than the one they're stored at.

Some work remains to be done, see the "TODO:" and "FIXME:" comments.
Further, while regression tests pass, this new linker should be tested on
different codebases (ideally while instrumented with `make develop` and
under valgrind).
The few errors spotted in the man pages (alignment) need to be corrected.
Finally, documentation comments need to be written, I have written a lot of
them but not all.

This also provides a significant performance boost (benchmarked with a
51994-symbol project):

Current master RGBLINK:
2.02user 0.03system 0:02.06elapsed 99%CPU (0avgtext+0avgdata 84336maxresident)k
0inputs+11584outputs (0major+20729minor)pagefaults 0swaps

Rewritten RGBLINK:
0.19user 0.06system 0:00.63elapsed 40%CPU (0avgtext+0avgdata 32460maxresident)k
23784inputs+11576outputs (0major+7672minor)pagefaults 0swaps
2019-11-02 22:37:10 +01:00
ISSOtm
f7c2665e14 Fix errors in make develop 2019-10-30 13:34:21 +01:00
ISSOtm
0f4d543aeb Have make clean delete all .o files in source directory
This will work better if files are rearranged in the future.
This appears to be POSIX-compliant, so why wasn't it used earlier?
2019-09-25 03:17:36 +02:00
ISSOtm
1288737c0d Clean up suffix rules
Generate .c files from .l files instead of directly a .o
Improve yacc and lex header generation dependency
2019-09-07 13:19:32 +00:00
ISSOtm
5902306271 Have make clean delete all generated .o files
Especially important if the file structure changes, to avoid
leaving stale object files in non-fresh repos.
2019-09-07 12:53:30 +00:00
ISSOtm
2fe4521a96 Remove locallex.o reference
The file was deleted in 8e88659, finish eliminating it
2019-09-07 12:53:30 +00:00
ISSOtm
74673436a1 Separate LDFLAGS from CFLAGS 2019-09-07 12:53:29 +00:00
ISSOtm
65fc42cce5 Remove -Wchkp from develop target
This option has been removed in GCC 9, and according to GCC 8.2's man page,
only has an implementation on Intel MRX anyways.
2019-09-05 05:56:11 +02:00
dbrotz
e05199ca1e Add support for multiple charmaps
This adds two new directives: newcharmap and setcharmap.
newcharmap creates a new charmap and switches to it.
setcharmap switches to an existing charmap.
2019-08-29 21:54:06 -07:00
Antonio Niño Díaz
a761e98e18 Run checkpatch against origin/master
The develop branch has been deleted. Remove references to it.
2019-05-10 00:16:27 +01:00
dbrotz
3806eb3139 Fix ambiguity in const parsing 2018-12-02 13:49:12 -08:00
Antonio Niño Díaz
6fe2741f2d Enable GCC options to detect undefined behaviour
GCC has an Undefined Behavior Sanitizer (ubsan), which enables run-time
checks of undefined behaviour. It has been enabled for the `develop`
build target.

A small bug detected with it has been fixed.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-04-28 00:57:25 +01:00
Antonio Niño Díaz
e99a651165 Create makefile target to check all warnings
Remove '-Werror' from the default make target to make it easy for
regular users of RGBDS to compile the source code. Only a few basic
warnings are left in that target.

All the warnings have been moved to a new target called 'develop'. This
target is now the one used in Travis CI to check for problems during
compilation.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-04-02 22:53:48 +01:00
Antonio Niño Díaz
95ccc48d0c Enable -Wundef
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-04-02 22:53:48 +01:00
Antonio Niño Díaz
340362d984 Enable a few warning flags
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-04-02 22:53:48 +01:00
Antonio Niño Díaz
516e4578ea Enable more optional warnings
-Wformat-truncation is set to 1 instead of 2 because in some cases the
return value of snprintf is used to warn about truncations but GCC still
creates a warning for it, preventing the compilation from continuing.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-04-01 01:42:55 +01:00
Antonio Niño Díaz
9829be1045 Enable -Wextra
-Wsign-compare has been disabled because flex generates a comparison
that triggers a warning and cannot be fixed in the code.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-04-01 01:42:55 +01:00
Antonio Niño Díaz
b28a16c0da Enable -Wpedantic
Fix a few warnings related needed to build the source with this option.

Add new exception to .checkpatch.conf.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-04-01 00:56:00 +01:00
Antonio Niño Díaz
0e0e12a769 Add CSS file for the html documentation
It has been obtained from here:

http://mdocml.bsd.lv/cgi-bin/cvsweb/mandoc.css

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-02-24 16:40:55 +00:00
Antonio Niño Díaz
a6b244b12e Move version files out of extern folder
The folder extern is reserved for external contributions, not common
files.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-28 13:07:21 +00:00
Antonio Niño Díaz
c071586ae5 Remove dependency of reallocarray()
By removing this dependency, all of the code of this repository is
licensed under the MIT license.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 00:30:13 +00:00
Antonio Niño Díaz
c6187be210 Remove dependency of strlcpy()
There was only one place where `strlcpy` was still used.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 00:02:44 +00:00
Antonio Niño Díaz
f9f3bb7761 Remove dependency of strlcat()
There was only one place where `strlcat` was used, and `snprintf`
actually does a better job at what the code was trying to achieve.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 00:02:26 +00:00
Antonio Niño Díaz
1a5c423984 Relicense codebase under MIT license
With permission from the main authors [1], most of the code has been
relicensed under the MIT license.

SPDX license identifiers are used so that the license headers in source
code files aren't too large.

Add CONTRIBUTORS.rst file.

[1] https://github.com/rednex/rgbds/issues/128

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-26 22:59:02 +00:00
Antonio Niño Díaz
b382dffdec Split src/asm/charmap.c into two files
This way it is easier to identify the license of the code.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-26 22:55:13 +00:00
Antonio Niño Díaz
33e9eb098c Exclude html files from checkpatch
Also, fix 2 nits in the codebase.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-26 18:57:25 +00:00
Antonio Niño Díaz
698ed9d5fc Don't clean html files with make clean
Added a new target to remove html files: `cleanwwwman`.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-25 22:12:31 +00:00
Antonio Niño Díaz
494b98e46a Fix html doc file name
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-24 20:29:09 +00:00
Antonio Niño Díaz
d1ff057889 Make clean target of Makefile clean html files
The html files generated with `make wwwman` weren't cleaned correctly
with `clean`.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-23 22:54:37 +00:00
Antonio Niño Díaz
292302c6d1 Move documentation to this repository
Modified Makefile wwwman target to output files inside docs/.

Modified .gitignore to allow *.html files.

Update README.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-23 21:28:10 +00:00
Antonio Niño Díaz
8d89ba39d4 Decouple commands in checkpatch Makefile target
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-04 21:54:10 +00:00
Antonio Niño Díaz
8e8865940a Join list of keywords of locallex.c and globlex.c
It made sense to have them in different files when the toolchain
targeted systems other than the GB. Now, there are no generic and
system-specific keywords because there is only one supported system.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-04 01:28:23 +00:00
Antonio Niño Díaz
3c14f9760f Fix echo command in checkpatch target in Makefile
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-03 19:46:48 +01:00