specified on the command line. git-svn-id: svn://svn.cc65.org/cc65/trunk@4271 b7a2c559-68d2-44c3-8de9-860c34a00d81
66 lines
1.2 KiB
Makefile
66 lines
1.2 KiB
Makefile
#
|
|
# Makefile for the od65 object file dump utility
|
|
#
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# The executable to build
|
|
EXE = od65
|
|
|
|
# Library dir
|
|
COMMON = ../common
|
|
|
|
#
|
|
CC = gcc
|
|
CFLAGS = -O2 -g -Wall -W -std=c89
|
|
override CFLAGS += -I$(COMMON)
|
|
EBIND = emxbind
|
|
LDFLAGS =
|
|
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# List of all object files
|
|
|
|
OBJS = dump.o \
|
|
error.o \
|
|
fileio.o \
|
|
global.o \
|
|
main.o
|
|
|
|
LIBS = $(COMMON)/common.a
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Makefile targets
|
|
|
|
# Main target - must be first
|
|
.PHONY: all
|
|
ifeq (.depend,$(wildcard .depend))
|
|
all: $(EXE)
|
|
include .depend
|
|
else
|
|
all: depend
|
|
@$(MAKE) -f make/gcc.mak all
|
|
endif
|
|
|
|
$(EXE): $(OBJS) $(LIBS)
|
|
$(CC) $^ $(LDFLAGS) -o $@
|
|
@if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
|
|
|
|
clean:
|
|
$(RM) *~ core.* *.map
|
|
|
|
zap: clean
|
|
$(RM) *.o $(EXE) .depend
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Make the dependencies
|
|
|
|
.PHONY: depend dep
|
|
depend dep: $(OBJS:.o=.c)
|
|
@echo "Creating dependency information"
|
|
$(CC) $(CFLAGS) -MM $^ > .depend
|
|
|
|
|
|
|