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

EXECUTABLE := ut

all: $(MAINSRC) $(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)