gbdk-releases/sdcc/sim/ucsim/main.mk

135 lines
2.7 KiB
Makefile
Raw Permalink Normal View History

2015-01-10 16:25:06 +01:00
#
# S51 main.mk
#
# (c) Drotos Daniel, Talker Bt. 1997,99
#
STARTYEAR = 1997
SHELL = /bin/sh
2015-01-10 16:25:09 +01:00
CXX = i586-mingw32msvc-g++
2015-01-10 16:25:06 +01:00
#CPP = @CPP@
2015-01-10 16:25:09 +01:00
CXXCPP = i586-mingw32msvc-g++ -E
RANLIB = i586-mingw32msvc-ranlib
INSTALL = /usr/bin/install -c
2015-01-10 16:25:06 +01:00
PRJDIR = .
2015-01-10 16:25:09 +01:00
SIMDIR = sim.src
2015-01-10 16:25:06 +01:00
2015-01-10 16:25:09 +01:00
DEFS = $(subs -DHAVE_CONFIG_H,,-DHAVE_CONFIG_H)
2015-01-10 16:25:06 +01:00
# FIXME: -Imcs51 must be removed!!!
2015-01-10 16:25:09 +01:00
CPPFLAGS = -I$(PRJDIR) -I$(PRJDIR)/$(SIMDIR)
CFLAGS = -I$(PRJDIR) -Wall
CXXFLAGS = -ggdb -O -pipe -I$(PRJDIR) -Wall
M_OR_MM = -MM
LIB_LIST = sim cmd sim util
UCSIM_LIBS = $(patsubst %,-l%,$(LIB_LIST))
UCSIM_LIB_FILES = $(patsubst %,lib%.a,$(LIB_LIST))
LIBS =
prefix = /sdcc
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
libdir = ${exec_prefix}/lib
datadir = ${prefix}/share
includedir = ${prefix}/include
mandir = ${prefix}/man
2015-01-10 16:25:06 +01:00
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
2015-01-10 16:25:09 +01:00
infodir = ${prefix}/info
srcdir = .
2015-01-10 16:25:06 +01:00
OBJECTS = pobj.o globals.o utils.o
2015-01-10 16:25:09 +01:00
SOURCES = $(patsubst %.o,%.cc,$(OBJECTS))
UCSIM_OBJECTS = ucsim.o
UCSIM_SOURCES = $(patsubst %.o,%.cc,$(UCSIM_OBJECTS))
ALL_SOURCES = $(SOURCES) $(UCSIM_SOURCES)
2015-01-10 16:25:06 +01:00
# Compiling entire program or any subproject
# ------------------------------------------
all: checkconf libs
libs: libutil.a
2015-01-10 16:25:09 +01:00
main_app: checkconf ucsim_app
2015-01-10 16:25:06 +01:00
# Compiling and installing everything and runing test
# ---------------------------------------------------
install: all installdirs
# Deleting all the installed files
# --------------------------------
uninstall:
rm -f $(bindir)/s51
rm -f $(bindir)/savr
rm -f $(bindir)/serialview
rm -f $(bindir)/portmon
# Performing self-test
# --------------------
check:
# Performing installation test
# ----------------------------
installcheck:
# Creating installation directories
# ---------------------------------
installdirs:
# Creating dependencies
# ---------------------
dep: main.dep
2015-01-10 16:25:09 +01:00
main.dep: $(ALL_SOURCES) *.h
$(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(ALL_SOURCES) >main.dep
2015-01-10 16:25:06 +01:00
include main.dep
include clean.mk
#parser.cc: parser.y
#plex.cc: plex.l
# My rules
# --------
libutil.a: $(OBJECTS)
2015-01-10 16:25:09 +01:00
$(AR) -rcu $*.a $(OBJECTS)
2015-01-10 16:25:06 +01:00
$(RANLIB) $*.a
2015-01-10 16:25:09 +01:00
ucsim_app: libs ucsim
ucsim: $(UCSIM_OBJECTS) $(UCSIM_LIB_FILES)
$(CXX) $(CXXFLAGS) -o $@ $< -L$(PRJDIR) $(UCSIM_LIBS) $(LIBS)
2015-01-10 16:25:06 +01:00
.cc.o:
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
.y.cc:
rm -f $*.cc $*.h
$(YACC) -d $<
mv y.tab.c $*.cc
mv y.tab.h $*.h
.l.cc:
rm -f $*.cc
$(LEX) -t $< >$*.cc
# Remaking configuration
# ----------------------
checkconf:
@if [ -f devel ]; then\
2015-01-10 16:25:09 +01:00
echo "MAIN.MK checkconf";\
2015-01-10 16:25:06 +01:00
$(MAKE) -f conf.mk srcdir="$(srcdir)" freshconf;\
fi
# End of main_in.mk/main.mk