Author: Rogério Brito Description: Create short Makefiles for compiling just the necessary parts for a Debian-based (and possibly other distributions) HFS+ filesystem utilities. --- /dev/null +++ b/Makefile.lnx @@ -0,0 +1,8 @@ +CC := gcc +CFLAGS += -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 +SUBDIRS := newfs_hfs.tproj fsck_hfs.tproj + +all clean: + for d in $(SUBDIRS); do $(MAKE) -C $$d -f Makefile.lnx $@; done + +export CC CFLAGS --- /dev/null +++ b/fsck_hfs.tproj/Makefile.lnx @@ -0,0 +1,16 @@ +CFILES = fsck_hfs.c strings.c utilities.c cache.c fsck_debug.c +OFILES = $(CFILES:.c=.o) + +all: fsck_hfs + +fsck_hfs: $(OFILES) dfalib/libdfa.a + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES) dfalib/libdfa.a -lbsd + +dfalib/libdfa.a: FORCE + $(MAKE) -C dfalib -f Makefile.lnx CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" libdfa.a + +clean: + $(RM) fsck_hfs $(OFILES) + $(MAKE) -C dfalib -f Makefile.lnx clean + +.PHONY : FORCE clean --- /dev/null +++ b/fsck_hfs.tproj/dfalib/Makefile.lnx @@ -0,0 +1,15 @@ +CFILES = hfs_endian.c BlockCache.c\ + BTree.c BTreeAllocate.c BTreeMiscOps.c \ + BTreeNodeOps.c BTreeScanner.c BTreeTreeOps.c\ + CatalogCheck.c HardLinkCheck.c\ + SBTree.c SControl.c SVerify1.c SVerify2.c\ + SRepair.c SRebuildCatalogBTree.c\ + SUtils.c SKeyCompare.c SDevice.c SExtents.c SAllocate.c\ + SCatalog.c SStubs.c VolumeBitmapCheck.c +OFILES = $(CFILES:.c=.o) + +libdfa.a: $(OFILES) + ar rc $@ $? + +clean: + $(RM) $(OFILES) libdfa.a --- /dev/null +++ b/newfs_hfs.tproj/Makefile.lnx @@ -0,0 +1,12 @@ +CFILES = hfs_endian.c makehfs.c newfs_hfs.c +OFILES = $(CFILES:.c=.o) + +all: newfs_hfs + +newfs_hfs: $(OFILES) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES) -lcrypto + +clean: + $(RM) newfs_hfs $(OFILES) + +.PHONY : FORCE clean