diff options
| author | Pali Rohár <pali.rohar@gmail.com> | 2019-05-06 21:47:33 +0200 |
|---|---|---|
| committer | Pali Rohár <pali.rohar@gmail.com> | 2019-05-06 21:47:33 +0200 |
| commit | f3da31d7a3e4b300f325624bf4e424c3bbcd521b (patch) | |
| tree | cdd5423fa05e56af5ea604edb8334a6692383365 /Makefile | |
| parent | 84295c9afc0b42a61cf687d54c3bd5e286fd5176 (diff) | |
| download | dlfcn-win32-f3da31d7a3e4b300f325624bf4e424c3bbcd521b.tar.gz dlfcn-win32-f3da31d7a3e4b300f325624bf4e424c3bbcd521b.tar.bz2 dlfcn-win32-f3da31d7a3e4b300f325624bf4e424c3bbcd521b.zip | |
Load Psapi.dll at runtime, this avoids linking caveat
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 9 |
1 files changed, 4 insertions, 5 deletions
| @@ -3,7 +3,6 @@ | |||
| 3 | # | 3 | # |
| 4 | include config.mak | 4 | include config.mak |
| 5 | CFLAGS = -Wall -O3 -fomit-frame-pointer | 5 | CFLAGS = -Wall -O3 -fomit-frame-pointer |
| 6 | LIBS += -lpsapi | ||
| 7 | 6 | ||
| 8 | ifeq ($(BUILD_SHARED),yes) | 7 | ifeq ($(BUILD_SHARED),yes) |
| 9 | TARGETS += libdl.dll | 8 | TARGETS += libdl.dll |
| @@ -34,7 +33,7 @@ libdl.a: $(LIB_OBJS) | |||
| 34 | $(RANLIB) libdl.a | 33 | $(RANLIB) libdl.a |
| 35 | 34 | ||
| 36 | libdl.dll: $(LIB_OBJS) | 35 | libdl.dll: $(LIB_OBJS) |
| 37 | $(CC) $(SHFLAGS) -shared -o $@ $^ $(LIBS) | 36 | $(CC) $(SHFLAGS) -shared -o $@ $^ |
| 38 | 37 | ||
| 39 | libdl.lib: libdl.dll | 38 | libdl.lib: libdl.dll |
| 40 | $(LIBCMD) /machine:i386 /def:libdl.def | 39 | $(LIBCMD) /machine:i386 /def:libdl.def |
| @@ -54,20 +53,20 @@ static-install: include-install | |||
| 54 | mkdir -p $(DESTDIR)$(libdir) | 53 | mkdir -p $(DESTDIR)$(libdir) |
| 55 | cp libdl.a $(DESTDIR)$(libdir) | 54 | cp libdl.a $(DESTDIR)$(libdir) |
| 56 | 55 | ||
| 57 | lib-install: $(LIBS) | 56 | lib-install: |
| 58 | mkdir -p $(DESTDIR)$(libdir) | 57 | mkdir -p $(DESTDIR)$(libdir) |
| 59 | cp libdl.lib $(DESTDIR)$(libdir) | 58 | cp libdl.lib $(DESTDIR)$(libdir) |
| 60 | 59 | ||
| 61 | install: $(INSTALL) | 60 | install: $(INSTALL) |
| 62 | 61 | ||
| 63 | test.exe: test.o $(TARGETS) | 62 | test.exe: test.o $(TARGETS) |
| 64 | $(CC) -o $@ $< -L. -ldl $(LIBS) | 63 | $(CC) -o $@ $< -L. -ldl |
| 65 | 64 | ||
| 66 | testdll.dll: testdll.c | 65 | testdll.dll: testdll.c |
| 67 | $(CC) -shared -o $@ $^ | 66 | $(CC) -shared -o $@ $^ |
| 68 | 67 | ||
| 69 | testdll2.dll: testdll2.c $(TARGETS) | 68 | testdll2.dll: testdll2.c $(TARGETS) |
| 70 | $(CC) -shared -o $@ $< -L. -ldl $(LIBS) | 69 | $(CC) -shared -o $@ $< -L. -ldl |
| 71 | 70 | ||
| 72 | testdll3.dll: testdll3.c | 71 | testdll3.dll: testdll3.c |
| 73 | $(CC) -shared -o $@ $^ | 72 | $(CC) -shared -o $@ $^ |
