diff options
author | Marvin Borner | 2021-12-30 17:23:51 +0100 |
---|---|---|
committer | Marvin Borner | 2021-12-30 17:23:51 +0100 |
commit | 028755c57007c3241e287b9927c6810814eecde1 (patch) | |
tree | c4c5a8826390f651f975425f96e275395db43c19 /makefile | |
parent | 6236c3d88ccba4429cbb4020ea0ed02816282451 (diff) |
Makemake crakecrake
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -22,16 +22,19 @@ compile: all sync clean: @rm -rf $(BUILD)/* -run: compile $(BUILD) $(BUILD)/disk.img +clean_disk: + @rm -rf $(BUILD)/*.img + +run: compile $(BUILD) clean_disk $(BUILD)/disk.img sync: # Ugly hack - @$(MAKE) --always-make --dry-run | grep -wE 'gcc' | grep -w '\-c' | jq -nR '[inputs|{directory: match("/marfs/build/[^.]+").string[14:], command: ., file: match(" [^ ]+$$").string[1:]}]' >compile_commands.json & + @$(MAKE) --always-make --dry-run | grep -wE 'gcc' | jq -nR '[inputs|{directory: ".", command: ., file: match(" [^ ]+$$").string[1:]}]' >compile_commands.json & @$(TG) -R --exclude=.git --exclude=build . & $(BUILD)/%.c.o: %.c - @$(CC) $(CFLAGS) $< -o $(patsubst $(BUILD)/$(SRC)/%.c.o,$(BUILD)/%,$@) + @$(CC) $(CFLAGS) $< -o $(patsubst $(BUILD)/$(SRC)/%.c.o,$(BUILD)/marfs_%,$@) -.PHONY: all run compile clean sync +.PHONY: all run compile clean clean_disk sync $(BUILD): @mkdir -p $@ @@ -40,6 +43,6 @@ $(BUILD): @dd if=/dev/zero of=$@ bs=1k count=32k status=none @DEV=$$($(SU) losetup --find --partscan --show $@) && \ PART="p1" && \ - $(SU) parted -s "$$DEV" mklabel msdos mkpart primary ext2 32k 100% -a minimal set 1 boot on && \ - echo Formatting... && \ + $(SU) parted -s "$$DEV" mklabel msdos mkpart primary 32k 100% -a minimal set 1 boot on && \ + $(SU) ./build/marfs_mkfs "$$DEV$$PART" && \ $(SU) losetup -d "$$DEV" |