diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-11-20 17:20:44 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-11-20 17:20:44 -0500 |
| commit | 23f0ae0207876505774e27dbe1c06e6e51f8989a (patch) | |
| tree | d101ccf02d16167f33494658e939ca11c72c6ca1 /src | |
| parent | b49c71cd0b46ddeea22a3c1c69eb197023d8720b (diff) | |
| download | unalf-23f0ae0207876505774e27dbe1c06e6e51f8989a.tar.gz | |
Fix Makefile so it works with non-GNU makes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile index 43ce094..58dba18 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ # Makefile for unalf, by B. Watson. WTFPL. -# Tested with GNU make. Does not work with BSD make, sorry. +# Tested with GNU make, BSD make, makepp, and Schily's dmake. ### Override these variables as needed. Don't override CFLAGS; use # COPT instead. @@ -39,16 +39,27 @@ VERSION=0.1.0 CFLAGS=-DVERSION='"$(VERSION)"' -Wall -I../f65 $(COPT) +UNALF_OBJS=unalf.o io.o listalf.o extract.o f65.o glob.o opts.o usage.o self.o +ALFSUM_OBJS=alfsum.o self.o + .PHONY: all clean install all: unalf unalf.1 alfsum alfsum.1 -unalf: unalf.o io.o listalf.o extract.o ../f65/f65.o glob.o opts.o usage.o self.o +# unalf and alfsum need explicit rules for BSD make compatibility. +# without them, bmake tries to run "cc -o unalf unalf.c" which ain't +# gonna ever work. +unalf: $(UNALF_OBJS) + $(CC) $(LDFLAGS) -o $@ $(UNALF_OBJS) alfsum: alfsum.o self.o + $(CC) $(LDFLAGS) -o $@ $(ALFSUM_OBJS) usage.o: usage.c +f65.o: ../f65/f65.c ../f65/f65.h + $(CC) $(CFLAGS) -c -o f65.o ../f65/f65.c + usage.c: mkusage.pl unalf.rst perl mkusage.pl unalf.rst > usage.c @@ -64,8 +75,6 @@ listalf.o: listalf.c addrs.h unalf.h ../f65/f65.h extract.o: extract.c addrs.h unalf.h ../f65/f65.h -../f65/f65.o: ../f65/f65.c ../f65/f65.h - ver.rst: echo '.. |version| replace:: $(VERSION)' > ver.rst @@ -76,7 +85,7 @@ alfsum.1: alfsum.rst ver.rst manftr.rst $(RST2MAN) alfsum.rst > alfsum.1 clean: - rm -rf *.o unalf alfsum ../f65/f65.o *.exe wintmp \ + rm -rf *.o unalf alfsum *.exe wintmp \ unalf.html alfsum.html *.aarch64.elf *.com.dbg # these are generated files, but they *are* checked into git. |
