aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/Makefile
blob: 89d3d1b4532ba7819f6176c0c1901f6f214e8071 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CFLAGS := -c -Wall -D__DMSDOS_LIB__
LDFLAGS :=
SOURCES := mcdmsdos.c
BUILD_DIR := ./build
MAINSRC := mcdmsdos.c
LIBSRC := $(shell find ./lib/ -name '*.c')
SRC := $(MAINSRC) $(LIBSRC)
OBJS := $(SRC:%=$(BUILD_DIR)/%.o)

EXECUTABLE := mcdmsdosnext

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJS) 
	$(CC) $(LDFLAGS) $(OBJS) -o $(BUILD_DIR)/$@

$(BUILD_DIR)/%.c.o: %.c
	mkdir -p $(dir $@)
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -r $(BUILD_DIR)