Makefile cleanup. Among other things, allow use of the --as-needed linker flag
by rearranging arguments for the linker. git-svn-id: svn://svn.cc65.org/cc65/trunk@3922 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
#
|
||||
#
|
||||
# gcc Makefile for da65
|
||||
#
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# The executable to build
|
||||
EXE = da65
|
||||
|
||||
# Library dir
|
||||
COMMON = ../common
|
||||
|
||||
@@ -33,29 +38,28 @@ OBJS = asminc.o \
|
||||
LIBS = $(COMMON)/common.a
|
||||
|
||||
|
||||
EXECS = da65
|
||||
# ------------------------------------------------------------------------------
|
||||
# Makefile targets
|
||||
|
||||
# Main target - must be first
|
||||
.PHONY: all
|
||||
ifeq (.depend,$(wildcard .depend))
|
||||
all : $(EXECS)
|
||||
all: $(EXE)
|
||||
include .depend
|
||||
else
|
||||
all: depend
|
||||
@$(MAKE) -f make/gcc.mak all
|
||||
endif
|
||||
|
||||
|
||||
|
||||
da65: $(OBJS) $(LIBS)
|
||||
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
|
||||
@if [ $(OS2_SHELL) ] ; then $(EBIND) $@ ; fi
|
||||
$(EXE): $(OBJS) $(LIBS)
|
||||
$(CC) $^ $(LDFLAGS) -o $@
|
||||
@if [ $(OS2_SHELL) ] ; then $(EBIND) $(EXE) ; fi
|
||||
|
||||
clean:
|
||||
$(RM) *~ core *.map
|
||||
$(RM) *~ core.* *.map
|
||||
|
||||
zap: clean
|
||||
$(RM) *.o $(EXECS) .depend
|
||||
|
||||
$(RM) *.o $(EXE) .depend
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Make the dependencies
|
||||
|
||||
Reference in New Issue
Block a user