CFLAGS += $(OFLAGS) $(INCLUDES) $(OPTIONS)
LDFLAGS += -g $(OPTIONS)
+LDOPT = linker
ifeq ($(OS),Windows_NT)
#LDLIBS += -lws2_32
+LDOPT = winlnk
endif
%.ld: %.c
$(call TITLE, "Building $@")
- echo ${<:.c=.exe}: $(shell perl -- getcomments.pl -p='linker:\s' -f='%' $< | awk '{for (i=1;i<=NF;i++) if ($$(i) ~ /.o$$/) printf " %s", $$(i)}') > $@
+ echo ${<:.c=.exe}: $(shell perl -- getcomments.pl -p='$(LDOPT):\s' -f='%' $< | awk '{for (i=1;i<=NF;i++) if ($$(i) ~ /.o$$/) printf " %s", $$(i)}') > $@
$(call PASS, SUCCESS)
%.o: %.c
%.exe: %.o %.d
$(call TITLE, "Building $@")
- $(CC) $(LDFLAGS) $< $(shell perl -- getcomments.pl -p='linker:\s' -f='%' ${<:.o=.c}) $(LDLIBS) -o $@
+ $(CC) $(LDFLAGS) $< $(shell perl -- getcomments.pl -p='$(LDOPT):\s' -f='%' ${<:.o=.c}) $(LDLIBS) -o $@
$(call PASS, SUCCESS)
## Phony