aboutsummaryrefslogtreecommitdiffstats
path: root/tools/z80asm
diff options
context:
space:
mode:
Diffstat (limited to 'tools/z80asm')
-rw-r--r--tools/z80asm/Makefile32
1 files changed, 21 insertions, 11 deletions
diff --git a/tools/z80asm/Makefile b/tools/z80asm/Makefile
index a0a976d..b022c61 100644
--- a/tools/z80asm/Makefile
+++ b/tools/z80asm/Makefile
@@ -15,25 +15,35 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-CC = gcc
-LDFLAGS = -O2 -Wall
-CFLAGS = -O2 -Wall -Wwrite-strings -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wshadow -g -W -Ignulib
-SHELL = /bin/bash
-VERSION ?= $(shell echo -n `cat VERSION | cut -d. -f1`. ; echo $$[`cat VERSION | cut -d. -f2` + 1])
+CC = gcc
+LDFLAGS = -O2 -Wall
+CFLAGS = -O2 -Wall -Wwrite-strings -Wcast-qual -Wcast-align \
+ -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wredundant-decls -Wnested-externs \
+ -Winline -Wshadow -g -W -Ignulib
+VERSION ?= $(shell echo -n `cat VERSION | cut -d. -f1`. ; echo $$[`cat VERSION | cut -d. -f2` + 1])
+ifneq (,$(findstring _NT,$(shell uname -s)))
+O = obj
+X = .exe
+else
+O = o
+X =
+endif
-all:z80asm
+all: z80asm$(X)
-z80asm:z80asm.c Makefile gnulib/getopt.o gnulib/getopt1.o
- $(CC) $(CFLAGS) $(LDFLAGS) -DVERSION=\"$(shell cat VERSION)\" $< gnulib/getopt.o gnulib/getopt1.o -o $@
+z80asm$(X): z80asm.c Makefile gnulib/getopt.$(O) gnulib/getopt1.$(O)
+ $(CC) $(CFLAGS) $(LDFLAGS) -DVERSION=\"$(shell cat VERSION)\" \
+ $< gnulib/getopt.$(O) gnulib/getopt1.$(O) -o $@
-gnulib/%.o:gnulib/%.c gnulib/getopt.h Makefile
+gnulib/%.$(O): gnulib/%.c gnulib/getopt.h Makefile
$(CC) $(CFLAGS) -c $< -o $@
clean:
for i in . gnulib examples headers ; do \
- rm -f $$i/core $$i/*~ $$i/\#* $$i/*.o $$i/*.rom ; \
+ rm -f $$i/core $$i/*~ $$i/\#* $$i/*.$(O) $$i/*.rom ; \
done
- rm -f z80asm z80asm.exe
+ rm -f z80asm$(X) z80asm.exe
dist: clean
echo $(VERSION) > VERSION