diff --git a/ext2sim/Makefile b/ext2sim/Makefile index f7730f87..b1816314 100644 --- a/ext2sim/Makefile +++ b/ext2sim/Makefile @@ -11,12 +11,22 @@ EXTRA_LIBS = ${MAGICDIR}/extflat/libextflat.o ${MAGICDIR}/utils/libutils.a include ${MAGICDIR}/defs.mak LIBS += -lm ${LD_EXTRA_LIBS} ${SUB_EXTRA_LIBS} -CLEANS += exttosim${SHDLIB_EXT} simwrap.o +CLEANS += exttosim${SHDLIB_EXT} simwrap.o finds.o ext2sim_main.o ext2sim_main finds sim2simp -main: ext2sim +main: finds sim2simp # ext2sim_main # deprecated tcl-main: exttosim${SHDLIB_EXT} +# Not linkable due to libutils.a needing more hierarchical separation +ext2sim_main: ext2sim_main.o ${EXTRA_LIBS} ${MAGICDIR}/tiles/libtiles.o + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ $^ ${LIBS} -lX11 -lz + +ext2sim_main.o: ext2sim.c + ${CC} ${CFLAGS} -I${MAGICDIR} -DEXT2SIM_MAIN -c -o $@ $^ + +finds: finds.o ${MAGICDIR}/utils/libutils.a + ${CC} ${LDFLAGS} ${CFLAGS} -o $@ $^ + simwrap.o: ext2sim.c ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS} ext2sim.c -c -o simwrap.o diff --git a/ext2sim/ext2sim.c b/ext2sim/ext2sim.c index 76ca8e5a..c5bca513 100644 --- a/ext2sim/ext2sim.c +++ b/ext2sim/ext2sim.c @@ -707,7 +707,7 @@ runexttosim: TxPrintf("exttosim finished.\n"); } -#if 0 /* Independent program "ext2sim" deprecated */ +#ifdef EXT2SIM_MAIN /* Independent program "ext2sim" deprecated */ /* * ---------------------------------------------------------------------------- @@ -834,7 +834,7 @@ main( exit(0); } -#endif /* Deprecated */ +#endif /* EXT2SIM_MAIN Deprecated */ /* * ---------------------------------------------------------------------------- diff --git a/ext2sim/finds.c b/ext2sim/finds.c index 882d35a6..d5ba4154 100644 --- a/ext2sim/finds.c +++ b/ext2sim/finds.c @@ -1,8 +1,10 @@ #include "utils/magic.h" #include "utils/hash.h" +#include #include #include #include +#include char * token(