Source
...
Target
Commits (2)
  • Cameron Cawley's avatar
    Rewrite makefile to use CApp, and support building for Unix · be706d9f
    Cameron Cawley authored
    Version 6.24. Tagged as 'defmod-6_24'
    be706d9f
  • Ben Avison's avatar
    Permit selectable assembler backend · dd4cecde
    Ben Avison authored
    The name of the assembler binary used to generate object outputs was
    defined by the preprocessor macro ASMCMD: for native builds, it was
    "ObjAsm" and for cross-compilation builds, it was "armasm". Extend this
    so that the name of the assembler can be overridden at run time by the
    environment variable also called ASMCMD. This permits the tool to generate
    ELF format object files for use with GCCSDK.
    
    Version 6.25. Tagged as 'defmod-6_25'
    dd4cecde
/sources/c/defmod
/o/
/objs/
/Makefile.d
/defmod,ff8
/defmod-D,fd3
# Makefile for GNU defmod
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 16-Nov-99 SNB Created.
#
#
# Paths
#
VPATH = @ sources oslib support
COMPONENT ?= defmod
#
# Generic options:
#
MKDIR = do mkdir -p
AS = objasm
CP = copy
CC = cc
CM = cmhg
RM = remove
LD = link
LB = libfile
TOUCH = create
SQZ = squeeze
WIPE = x wipe
YACC = GNU.bison
ASMINCLUDES = -Ioslib
CINCLUDES = -Ioslib -Isources -Isupport
CDEFINES = -DPACE_BUILD -DTRACE=0
CFLAGS += ${C_NOWARN_NON_ANSI_INCLUDES}
YACCFLAGS = -y
OBJS = asmhelp cheader chelp cstrong def defmod hdr \
objasm realloc lookup x
DEFINES = -DRISCOS -DEXECUTE_ON_RISCOS -DPACE_BUILD
CCFLAGS = -c -depend !Depend -ffa ${INCLUDES} ${DEFINES} ${THROWBACK} -DTRACE=0 -Wp
YACCDEFS= -DYYDEBUG=0 -DYYMAXDEPTH=0
ASFLAGS = -depend !Depend -Stamp -quit ${THROWBACK} ${ASMINC}
CPFLAGS = ~cfr~v
LBFLAGS = -c
WFLAGS = ~CFR~V
SQZFLAGS = -f
YACCFLAGS = -y
VPATH = sources oslib support
SOURCES_TO_SYMLINK = $(wildcard sources/c/*)
SOURCES_TO_SYMLINK += $(wildcard sources/h/*)
SOURCES_TO_SYMLINK += $(wildcard sources/y/*)
SOURCES_TO_SYMLINK += $(wildcard oslib/h/*)
SOURCES_TO_SYMLINK += $(wildcard oslib/Hdr/*)
SOURCES_TO_SYMLINK += $(wildcard support/c/*)
SOURCES_TO_SYMLINK += $(wildcard support/h/*)
SOURCES_TO_SYMLINK += $(wildcard support/s/*)
SOURCES_TO_SYMLINK += $(wildcard unix/h/*)
#
# Libraries
#
CLIB = CLIB:o.stubs
ifneq (Host,${APCS})
CDEFINES += -DRISCOS -DEXECUTE_ON_RISCOS -DYYDEBUG=0 -DYYMAXDEPTH=0
OBJS += callback resource riscos riscosa
else
CINCLUDES += -Iunix
CDEFINES += -DUNIX -DEXECUTE_ON_UNIX
OBJS += unix
endif
DIRS=o._dirs
include CApp
#
# Include files
#
INCLUDES = -J@.,oslib.,support.,C: -Ioslib -Isources -Isupport -IC:
ASMINC = -Ioslib -Isources -Isupport
ifeq (,${MAKE_VERSION})
#
# Program specific options:
#
COMPONENT = defmod
ICOMPONENT = !Run
TARGET = ${COMPONENT}
SOURCE =
EXPORTS =
sources.c.defmod: sources.y.defmod
${YACC} ${YACCFLAGS} -o $@ sources.y.defmod
OBJS=o.asmhelp o.callback o.chelp o.def o.defmod o.cheader o.hdr o.x \
o.lookup o.objasm o.realloc o.resource o.riscos o.riscosa o.cstrong
o.defmod: sources.c.defmod
${CC} ${CFLAGS} -o $@ sources.c.defmod
LIBS=${CLIB}
clean::
${RM} sources.c.defmod
#
# Rule patterns
#
.SUFFIXES:
.SUFFIXES: .o .c .y .s
.c.o:
${CC} ${CCFLAGS} -o $@ $<
.s.o:
${AS} ${ASFLAGS} -o $@ $<
else
.y.c:
${YACC} ${YACCFLAGS} -o $@ $<
c.defmod: sources.y.defmod
${YACC} ${YACCFLAGS} -o c.defmod sources.y.defmod
o.defmod: c.defmod
${CC} ${CCFLAGS} ${YACCDEFS} -o $@ c.defmod
#
# build defmod
#
all: ${TARGET}
@|
install: all
${MKDIR} ${INSTDIR}.DefMod
${CP} ${TARGET} ${INSTDIR}.DefMod.!Run ${CPFLAGS}
@echo Installation of tool ${COMPONENT} complete
#
# RISC OS ROM build rules:
#
rom: ${TARGET}
@echo ${COMPONENT}: rom module built
export: export_${PHASE}
install_rom: ${TARGET}
@echo ${COMPONENT}: rom module installed
clean:
${WIPE} c ${WFLAGS}
${WIPE} o ${WFLAGS}
${RM} ${COMPONENT}
@echo ${COMPONENT}: cleaned
export_hdrs:
@echo ${COMPONENT}: export complete (hdrs)
export_libs:
@echo ${COMPONENT}: export complete (libs)
${DIRS}:
${MKDIR} c
${MKDIR} o
${TOUCH} $@
#
# Final link
#
${TARGET}: ${OBJS} ${LIBS} ${DIRS}
${LD} ${LDFLAGS} -o ${COMPONENT} ${OBJS} ${LIBS}
${SQZ} ${SQZFLAGS} $@
endif
# Dynamic dependencies:
/* (6.23)
/* (6.25)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 6.23
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Jan 2012
#define Module_MajorVersion_CMHG 6.25
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Aug 2022
#define Module_MajorVersion "6.23"
#define Module_Version 623
#define Module_MajorVersion "6.25"
#define Module_Version 625
#define Module_MinorVersion ""
#define Module_Date "14 Jan 2012"
#define Module_Date "20 Aug 2022"
#define Module_ApplicationDate "14-Jan-12"
#define Module_ApplicationDate "20-Aug-22"
#define Module_ComponentName "defmod"
#define Module_ComponentPath "gpl/RiscOS/Tools/Sources/GNU/defmod"
#define Module_FullVersion "6.23"
#define Module_HelpVersion "6.23 (14 Jan 2012)"
#define Module_LibraryVersionInfo "6:23"
#define Module_FullVersion "6.25"
#define Module_HelpVersion "6.25 (20 Aug 2022)"
#define Module_LibraryVersionInfo "6:25"
defmod
defmod.c
defs
*.o
defmod
defmod.c
defs
*.o
#
# Makefile for defmod for UNIX.
#
.SUFFIXES:
.SUFFIXES: .o .c
CC = gcc
CFLAGS = -I. -DPACE_BUILD -DUNIX -DEXECUTE_ON_UNIX
LD = gcc
LDFLAGS =
YACC = bison
YFLAGS =
OBJS = defmod.o lookup.o asmhelp.o chelp.o def.o cheader.o \
objasm.o realloc.o hdr.o unix.o cstrong.o x.o
defmod: ${OBJS}
${LD} ${LDFLAGS} -o $@ ${OBJS}
.c.o:
${CC} ${CFLAGS} -o $@ -c $<
defmod.o: defmod.c
defmod.c: defmod.y
${YACC} -y defmod.y -o defmod.c
clean:
rm -f *.o defmod defmod.c
realclean:
rm -f *.o defmod defmod.c
find . -type l -exec rm -f {} \;
links:
./mklinks
#!/usr/local/bin/bash
# usage: wantlink source dest
wantlink()
{
dir=$1
ext=$2
file=$3
source="../../$dir/$ext/$file";
dest="$file.$ext";
if [ ! -L $dest ];
then
echo ln -s $source $dest
ln -s $source $dest
fi
}
if [ ! -L VersionNum ];
then
echo ln -s ../../VersionNum VersionNum
ln -s ../../VersionNum VersionNum
fi
if [ ! -L oslib ];
then
echo ln -s . oslib
ln -s . oslib
fi
wantlink sources y defmod
wantlink sources h asmhelp
wantlink sources h cheader
wantlink sources h chelp
wantlink sources h cstrong
wantlink sources h def
wantlink sources h defmod_tb
wantlink sources h hdr
wantlink sources h main
wantlink sources h objasm
wantlink sources c asmhelp
wantlink sources c cheader
wantlink sources c chelp
wantlink sources c cstrong
wantlink sources c def
wantlink sources c hdr
wantlink sources c objasm
wantlink support h hostfs
wantlink support h lookup
wantlink support h trace
wantlink support h realloc
wantlink support h m
wantlink support h riscos
wantlink support h x
wantlink support c lookup
wantlink support c realloc
wantlink support c riscos
wantlink support c unix
wantlink support c x
wantlink oslib h os
wantlink oslib h fileswitch
wantlink oslib h osfind
wantlink oslib h osfile
wantlink oslib h macros
wantlink oslib h types
wantlink oslib h territory
wantlink oslib h messagetrans
......@@ -907,6 +907,12 @@ os_error *objasm_output
needs = needs, consts = consts, types = types;
#ifdef EXECUTE_ON_UNIX
char *asmcmd = getenv("ASMCMD");
if (asmcmd == NULL)
asmcmd = ASMCMD;
#endif
if (!separate)
{
if ((rc = Emit_Header (file, title, author)) < 0)
......@@ -1115,10 +1121,16 @@ os_error *objasm_output
name1, prefix_dir, name2, apcs32 ? 32 : 26))
< 0)
goto finish;
#else
#ifdef EXECUTE_ON_UNIX
if ((rc = sprintf (cmd, "%s -from %s -to %s "
"-stamp -quit -apcs 3/%dbit/SWstackcheck",
asmcmd, name1, name2, apcs32 ? 32 : 26)) < 0)
#else
if ((rc = sprintf (cmd, ASMCMD " -from %s -to %s "
"-stamp -quit -apcs 3/%dbit/SWstackcheck",
name1, name2, apcs32 ? 32 : 26)) < 0)
#endif
goto finish;
#endif
......
File moved
File moved