clean linux/windows included library
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 2 May 2024 15:19:37 +0000 (17:19 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 2 May 2024 15:19:37 +0000 (17:19 +0200)
cmore.c
makefile

diff --git a/cmore.c b/cmore.c
index ade7089d80fc8641575e75d64859fc4d55b9269e..89054e1a20b3a8f1f53a9ebffc8ee09c13f720c8 100644 (file)
--- a/cmore.c
+++ b/cmore.c
@@ -1,6 +1,7 @@
 /* depend: */
 /* cflags: */
 /* linker: cmd.o debug.o tui.o -lcurses */
+/* winlnk: cmd.o debug.o tui.o -lpdcurses */
 
 #include <stdlib.h>
 
index 9e0aa2828b8d66e6709c3b7c9b93bd8f9ed430dc..1624fa55331cbb4fbe3fa77974933ebd819b1960 100644 (file)
--- a/makefile
+++ b/makefile
@@ -15,8 +15,10 @@ CFLAGS += -W -Wall -Wextra -g
 CFLAGS += $(OFLAGS) $(INCLUDES) $(OPTIONS)
 LDFLAGS += -g $(OPTIONS)
 
+LDOPT = linker
 ifeq ($(OS),Windows_NT)
 #LDLIBS += -lws2_32
+LDOPT = winlnk
 endif
 
 
@@ -148,7 +150,7 @@ valgrind_%: %.exe
 
 %.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
@@ -159,7 +161,7 @@ valgrind_%: %.exe
 
 %.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