Commit Graph

51 Commits

Author SHA1 Message Date
compyx 68ce335f59 Replace shell code with GNU Make conditionals and functions
Use `ifeq` to provide two rules for the `avail` target: one that reports
an error if any of the symlink targets are missing and one that installs
the symlinks for the targets if they're all present.
2023-02-19 19:17:45 +01:00
compyx 5c12659cf4 make avail: check for presence of binaries before creating symbolic
links

To avoid creating broken symlinks, first check if the binaries exists in
bin/ and exit when they don't, with a message to first run `make`.
2023-02-19 14:01:14 +01:00
rofl0r 8669710c0f build: allow empty prefix
there was some concern that this will break windows' way of doing
file lookups relatively from the binary, rather than via hardcoded
locations, but so far each occurence adding e.g. "CA65_INC" to
the pathsearch is already shielded with an #ifndef _WIN32.

addressing #1726
2022-04-27 16:19:06 +00:00
rofl0r bf1ef6157c build: properly quote strings passed as cpp macros
until now, the strings intended to be hardcoded into the binary,
such as directory names and build id, were passed unquoted, which
means they're interpreted by the preprocessor as C tokens, rather
than strings, which can result in all sorts of "interesting"
behaviour such as interpreting paths starting with // as C++-style
comment.
this was then worked around using a stringize macro which turned
the tokens into a string (if they happened to be in a compatible
format).

adresses #1726
2022-04-25 16:52:46 +00:00
rofl0r d8482fbd57 build: allow the user to specify make V=1 for verbose build
it's often required to see the full commandline when things go wrong.
the standard way for Makefile-only based buildsystems and autoconf
is to pass V=1 to make.
2022-04-25 14:58:38 +00:00
Greg King b2ae73879b Added a URL to the snapshot's commit history as a comment in the Windows snapshot ZIPs. 2022-03-12 01:35:33 -05:00
Björn Esser 2f3955dbc7 src/Makefile: Simplify BUILD_ID logic. 2019-07-15 12:42:48 +02:00
Björn Esser 83e0c70de5 Replace GIT_SHA with a more versatile BUILD_ID definition.
When compiling cc65, it will by default place the git hash (if available) of
the checked out commit in the version string.  This isn't useful when building
a package for a Linux distribution, since there either won't be an upstream
git hash if there is one at all.

Thus we replace GIT_SHA with a more versatile BUILD_ID, which can be defined
to any arbitrary string.  When building, its contents will be appended to the
version string instead of the git hash.

If BUILD_ID is not defined by the user the behaviour will be exactly the same
as before.  That means BUILD_ID gets automatically defined to Git <GIT_SHA>,
if it can be determined from a checkout.
2019-06-09 20:17:15 +02:00
Greg King a6b04f6e97 Changed most "backticks" (grave accents) into apostrophes.
Quotations that are embraced by tick marks now look better, in most fonts.
2019-01-05 14:57:12 -05:00
existensialMemory 4fd17161eb
Update Makefile 2018-06-04 22:17:25 -04:00
Ben 1f245fbc0b Fix `make` failing in parent directories containing spaces 2018-06-04 21:27:04 -04:00
Oliver Schmidt e485e96de0 Suppress potential svnversion error output. 2017-11-30 19:17:45 +01:00
Stefan 7e4db1fdd6
Option removed 2017-11-22 18:17:43 +01:00
Stefan 44b13c1ca0
Subversion fallback
If you use don't use Git to access the repository, you will still get a revision number.
2017-11-22 01:02:02 +01:00
Pascal de Bruijn 19f6ae1d54 make: change uppercase prefix var 2017-07-22 16:38:50 +02:00
Oliver Schmidt 298dda0e71 Increased GCC optimization level. 2017-05-17 18:30:35 +02:00
Oliver Schmidt 669113b595 Added missing line continuation.
Fixes https://github.com/cc65/cc65/issues/408
2017-03-21 20:45:51 +01:00
Oliver Schmidt 8dd003d2b3 Added --print-target-path option.
If cc65 is installed and used as designed there's no need whatsoever for CC65_HOME (both on *IX and Windows) from the perspective of the cc65 binaries. If the user however has to access files from the 'target' directory thenhe ends up with some assumption on the cc65 installation path nevertheless :-(

In order to avoid this I added the --print-target-path option. It "exports" the logic used by the cc65 binaries to locate their files to the user thus allowing him to leverage the same logic to locate the target files in his build scripts / Makefiles.
2016-06-03 11:08:53 +02:00
Oliver Schmidt 8b685763d4 Renamed chrcvt to chrcvt65 and added it to the build.
The /Makefile presumes that all binaries are are named *65 so chrcvt had to be renamed in order to be added to the build.
2016-03-27 19:09:00 +02:00
Oliver Schmidt 276a836d7d Fixed typo. 2014-03-27 22:07:08 +01:00
Oliver Schmidt c9438ae1a7 Finetuned Git commit hash retrieval.
- Force usage of shell wrapper in order to allow to suppress potential message about git not found (thanks to Greg King).
- Do $(info GIT_SHA ...) only if there's something special - as done with the other $(info ...).
2014-03-27 21:40:28 +01:00
Oliver Schmidt 22c63e743a Replaced date with Git hash. 2014-03-18 22:41:32 +01:00
Oliver Schmidt 1d6000213c Removed references to $TRAVIS from Makefiles.
After all it seems much cleaner to explicitly control the behaviour from the .travis.yml file than to behave differently "under the hood" when detecting a Travis CI build.
2014-03-16 21:32:18 +01:00
Oliver Schmidt a178c44acb Moved USER_CFLAGS back to re-allow warning option overriding. 2014-03-09 15:17:51 +01:00
Oliver Schmidt 8236b0dd74 Upload zip file. 2014-03-09 01:20:39 +01:00
Oliver Schmidt 80ca7eb4e4 Create zip file. 2014-03-09 00:20:17 +01:00
Oliver Schmidt 1c73fa0a00 Moved .PHONY below definitions it refers to.
I must admit that I don't understand why but obviously it is necessary to place .PHONY below the definition of variables it refers to - although those variables are recursively expanded ones! Not doing so made libsrc/Makefile build only three target libraries.
2014-03-06 23:42:44 +01:00
Oliver Schmidt 30125afcc1 Moved from VS2013 to MinGW(-w64). 2014-03-06 22:32:24 +01:00
Oliver Schmidt 4f317d70c8 Removed -std=c89.
Using `struct stat` and `%m` surely doesn't qualify for ISO C90.
2014-03-05 13:03:33 +01:00
Oliver Schmidt e22fc15589 Deduct temporary library path name from library path name.
Actually there's no need to fiddle with any automatic temp file name generation as we can just modify the library path name to generate a perfect temporary library path name.
2014-02-10 21:28:03 +01:00
Oliver Schmidt 0d3a652544 Use -Werror only on Travis CI builds.
There's no need to intentionally break things for people trying to build cc65 with some obscure compiler. It's enough to make sure that no new warnings sneak into the code base by having Travis CI builds fail.
2014-02-09 19:48:30 +01:00
Oliver Schmidt 47828e1059 Define _SVID_SOURCE to get tempnam(). 2014-02-09 01:19:40 +01:00
Oliver Schmidt 74ece8256e Goals from top level Makefile should be known even if empty. 2014-02-05 22:31:46 +01:00
Oliver Schmidt e320fe3db8 Added 'install' target.
The 'install' target primarily aims to support pacaking tools. Therefore...
- It just presumes a "capable" install program to be present.
- There's intentionally no 'uninstall' target.
2014-01-29 21:42:26 +01:00
Oliver Schmidt 0adad044e7 Moved USER_CFLAGS to the other flags. 2013-12-19 09:17:41 +01:00
Christian Groessler 418209f923 - Add a way to give additional compiler flags with USER_CFLAGS.
- Add possibility to specify an file name extension for generated executables (PROGEXT).
2013-12-18 21:56:17 +01:00
Oliver Schmidt 32daa3dd2b Added support for 'prefix'.
If the variable 'prefix' is defined then the builtin search paths are set to
$(prefix)/lib/cc65/... allowing to build binaries intended for installation.

Note that the library build still works with these binaries as it generally
overrides the builtin search paths by setting the CC65_HOME env var.
2013-06-07 23:13:46 +02:00
Oliver Schmidt 3a028fb621 Turned sim65 into a lightweight cc65 execution environment.
The sim65 source code has been a construction site for over a decade.
I was looking for a simple cc65 program execution environment for
regression tests. So I decided to re-purpose sim65 for that task by
removing about everything but the 6502 emulation.

There's no memory mapped i/o emulation whatsoever. Rather exit(),
open(), close(), read() and write() calls are supported by mapping
them through a thin paravirtualization layer to the corresponding
host os functions.

Note: The sim65 6502 emulation provides means to switch between
6502 and 65C02 emulation but currently there are no actual 65C02
opcodes implemented.
2013-05-20 20:20:14 +02:00
Oliver Schmidt 753aa29b15 Have 'avail' not be dependent on 'all'.
There are two reasons for removing this dependency:
- If someone does 'make avail' on the top level Makefile he ends up with
  binaries but without libraries - not nice. Better do just "nothing" and
  have hin understand that he needs to do 'make [all]' on the top level
  Makfile first.
- If 'make avail' is done via 'sudo' it isn't desirable to do a large amount
  of work as root.
BTW: I wasn't sure if this dependency is a good thing in the first place
but I saw it in many examples ('install' depending on 'all') so I did it too.
2013-05-17 16:21:05 +02:00
Oliver Schmidt 352ceb166c Renamed [un]install goals to [un]avail.
The [un]install make goals have a rather fixed meaning for *ix users. The simple
symlinks provided here don't match the expectations users have from [un]install.
Therefore it is appropriate to rename them to "something" not tied to specific
expectations.
2013-05-15 11:59:51 +02:00
Oliver Schmidt 969c3b7488 Allow to build just the binaries or just the libraries from the top level Makefile. 2013-05-07 19:05:41 +02:00
Oliver Schmidt a8aeab5d57 Added support for building the MS VS solution from the Makefile. 2013-05-05 23:46:12 +02:00
Oliver Schmidt b6ebf71446 Reduced verbosity. 2013-05-05 22:36:53 +02:00
Oliver Schmidt 1c962f73f5 Make use of single character variable syntax for the formal parameter variable. 2013-05-04 11:59:42 +02:00
Oliver Schmidt 151cadf019 Replaced three function calls with one. 2013-05-02 23:57:26 +02:00
Oliver Schmidt 81f461a15c Placed libraries and the end of the linker cmdline. 2013-05-02 15:06:02 +03:00
Oliver Schmidt f94ac40637 Replace only actually changed archive members. 2013-04-29 17:14:08 +03:00
Oliver Schmidt 780f38acd5 Most hosts require the math library to be linked explicitly. 2013-04-29 17:03:14 +03:00
Oliver Schmidt 18e00a1f9b Made compatible with GNU make 3.81 2013-04-29 17:01:00 +03:00
Oliver Schmidt 9fece990be Replaced elaborate install logic with just a bunch of symlinks.
Maybe I'm naive but even after thinking about it for quite
some time I can't see why it should hurt to just build the
cc65 binaries from the sources "in place" and have 'make
install' simply create some symlinks in usr/local/bin.

The new Makfile builds the binaries with builtin search paths
matching their build location. So the symlinks in usr/local/bin
allow to allow to use them out-of-the-box without additional
environment variables.
2013-04-28 22:30:18 +02:00