| 1 | # |
| 2 | # the DASM macro assembler (aka small systems cross assembler) |
| 3 | # |
| 4 | # Copyright (c) 1988-2002 by Matthew Dillon. |
| 5 | # Copyright (c) 1995 by Olaf "Rhialto" Seibert. |
| 6 | # Copyright (c) 2003-2008 by Andrew Davie. |
| 7 | # Copyright (c) 2008 by Peter H. Froehlich. |
| 8 | # |
| 9 | # This program is free software; you can redistribute it and/or modify |
| 10 | # it under the terms of the GNU General Public License as published by |
| 11 | # the Free Software Foundation; either version 2 of the License, or |
| 12 | # (at your option) any later version. |
| 13 | # |
| 14 | # This program is distributed in the hope that it will be useful, |
| 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | # GNU General Public License for more details. |
| 18 | # |
| 19 | # You should have received a copy of the GNU General Public License along |
| 20 | # with this program; if not, write to the Free Software Foundation, Inc., |
| 21 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 22 | |
| 23 | # Executables will be generated in the trunk/src/ directory (the |
| 24 | # "current directory" as far as this Makefile is concerned). If |
| 25 | # you want to move them somewhere, trunk/bin/ say, do so in the |
| 26 | # trunk/ Makefile! |
| 27 | |
| 28 | |
| 29 | #GOPTI= -O -m32 # -O for more warnings; use -O0 for debugging, use -O3 for speed |
| 30 | |
| 31 | GWARN= -ansi -std=c99 -pedantic -Wall \ |
| 32 | -Wstrict-prototypes -Wdeclaration-after-statement \ |
| 33 | -Wold-style-definition -Wmissing-declarations -Wmissing-prototypes \ |
| 34 | -Wshadow -Wwrite-strings -Wcast-qual -Wnested-externs \ |
| 35 | -Wcast-align -Wpointer-arith -Wbad-function-cast \ |
| 36 | -Wformat-y2k -Wformat-nonliteral -Wformat-security \ |
| 37 | -Wfloat-equal -Wundef -Winline \ |
| 38 | # -Wfour-char-constants # Apple OS X only option, not needed anyway? |
| 39 | # -Wunused # definition is weird in man gcc, effect is weird too |
| 40 | # -Wextra -Wno-unused-parameter # no-unused tames extra a little |
| 41 | # -Wunreachable-code # seems to create 4 spurious warnings? |
| 42 | # -Wconversion # too many right now |
| 43 | # -Wtraditional # too many, not sure if it's worth it anyway |
| 44 | |
| 45 | #GDEBG= -g # -fprofile-arcs -ftest-coverage -pg # -D_FORTIFY_SOURCE=2 |
| 46 | |
| 47 | #CFLAGS= $(GOPTI) $(GWARN) $(GDEBG) |
| 48 | #LDFLAGS= -m32 -L/usr/lib32 |
| 49 | |
| 50 | ifeq ($(OS),Windows_NT) |
| 51 | detected_OS := Windows |
| 52 | else |
| 53 | detected_OS := $(shell uname -s) |
| 54 | ifeq ($(detected_OS),Darwin) |
| 55 | CFLAGS = -mmacosx-version-min=10.5 |
| 56 | endif |
| 57 | endif |
| 58 | |
| 59 | #CC= gcc |
| 60 | |
| 61 | OBJS= main.o ops.o globals.o exp.o symbols.o \ |
| 62 | mne6303.o mne6502.o mne68705.o mne6811.o mnef8.o mne68908.o |
| 63 | SRCS= main.c ops.c globals.c exp.c symbols.c \ |
| 64 | mne6303.c mne6502.c mne68705.c mne6811.c mnef8.c mne68908.c |
| 65 | |
| 66 | ALL= dasm ftohex |
| 67 | |
| 68 | all: $(info detected_OS is $(detected_OS)) \ |
| 69 | $(ALL) |
| 70 | |
| 71 | dasm: $(OBJS) |
| 72 | $(CC) $(CFLAGS) $(OBJS) -o dasm $(LDFLAGS) |
| 73 | |
| 74 | ftohex: ftohex.o |
| 75 | |
| 76 | obj: $(OBJS) |
| 77 | |
| 78 | $(OBJS): asm.h |
| 79 | |
| 80 | clean: |
| 81 | rm -rf *.o $(ALL) \ |
| 82 | dasm-alpha-*.tar.gz \ |
| 83 | *.gcda *.gcno *.gcov gmon.out |
| 84 | |
| 85 | # prepare an alpha release containing just the source code, |
| 86 | # nothing else is in the archive since it is not intended |
| 87 | # for the public, just designated volunteers |
| 88 | |
| 89 | alpha: |
| 90 | echo "This is an incomplete alpha release of DASM source code." >README.ALPHA |
| 91 | echo "The purpose is to identify build problems, nothing more." >>README.ALPHA |
| 92 | echo "Please do *not* re-distribute this release in any form!" >>README.ALPHA |
| 93 | echo "Please do *not* distribute binaries derived from it either!" >>README.ALPHA |
| 94 | tar zcvf dasm-alpha-`date +%F`.tar.gz README.ALPHA Makefile *.h *.c |
| 95 | rm -rf README.ALPHA |