summaryrefslogtreecommitdiff
path: root/Maakbestand
diff options
context:
space:
mode:
Diffstat (limited to 'Maakbestand')
-rw-r--r--Maakbestand7
1 files changed, 5 insertions, 2 deletions
diff --git a/Maakbestand b/Maakbestand
index e760b65..98e0798 100644
--- a/Maakbestand
+++ b/Maakbestand
@@ -1,5 +1,5 @@
CC := gcc
-CFLAGS := -Wall -Wextra -std=c11 -O2
+CFLAGS := -Wall -Wextra -std=c2x -O2
LDFLAGS :=
OBJDIR := obj
@@ -9,6 +9,8 @@ SOURCES := $(shell find src -type f -name '*.c')
HEADERS := $(shell find src -type f -name '*.h')
OBJECTS := $(patsubst src/%.c,obj/%.o,$(SOURCES))
+PROGNAMES_X := $(patsubst src/%.c,X(%),$(wildcard src/*.c))
+
.PHONY: all clean
all: $(TARGET)
@@ -17,7 +19,8 @@ clean:
rm -rf $(OBJDIR) $(TARGET)
$(TARGET): main.c $(OBJECTS)
- $(CC) -o $@ $^ $(LDFLAGS)
+ $(CC) -o $@ $^ $(LDFLAGS) -DPROGNAMES_XLIST="$(PROGNAMES_X)"
$(OBJECTS): obj/%.o: src/%.c $(HEADERS)
+ @mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c -o $@ $<