Skip to content

Instantly share code, notes, and snippets.

@mingwandroid
Last active August 29, 2015 14:24
Show Gist options
  • Save mingwandroid/863a7a52ac614230012f to your computer and use it in GitHub Desktop.
Save mingwandroid/863a7a52ac614230012f to your computer and use it in GitHub Desktop.
.PHONY: hello/libtest.a.in hello/libtest.a
DTLIB32 = /OUT:$@ /DEF:`echo $@ | $(SED) 's|/lib|/|;s|\.a|.def|'`
SED ?= sed
hello/libtest.a: hello/libtest.a.in
./test.exe $(DTLIB32)
all: hello/libtest.a
$ make all
./test.exe "/OUT:hello/libtest.a "/DEF:`echo hello/libtest.a | sed 's|/lib|/|;s|\.a|.def|'`
Proggy arg[1] = /OUT:hello/libtest.a /DEF:hello/test.def
// Compile with mingw-w64 GCC as: gcc test.c -o test.exe
#include <stdio.h>
int main(int argc, char * argv[]) {
int i;
for (i = 1; i < argc; ++i) {
printf("Proggy arg[%d] = %s\n", i, argv[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment