diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 20 |
1 files changed, 10 insertions, 10 deletions
| @@ -2,7 +2,7 @@ | |||
| 2 | # dlfcn-win32 Makefile | 2 | # dlfcn-win32 Makefile |
| 3 | # | 3 | # |
| 4 | include config.mak | 4 | include config.mak |
| 5 | CFLAGS = -Wall -O3 -fomit-frame-pointer | 5 | CFLAGS = -Wall -O3 -fomit-frame-pointer -Isrc |
| 6 | 6 | ||
| 7 | ifeq ($(BUILD_SHARED),yes) | 7 | ifeq ($(BUILD_SHARED),yes) |
| 8 | TARGETS += libdl.dll | 8 | TARGETS += libdl.dll |
| @@ -21,13 +21,13 @@ ifeq ($(BUILD_MSVC),yes) | |||
| 21 | INSTALL += lib-install | 21 | INSTALL += lib-install |
| 22 | endif | 22 | endif |
| 23 | 23 | ||
| 24 | SOURCES := dlfcn.c | 24 | SOURCES := src/dlfcn.c |
| 25 | HEADERS := dlfcn.h | 25 | HEADERS := src/dlfcn.h |
| 26 | 26 | ||
| 27 | all: $(TARGETS) | 27 | all: $(TARGETS) |
| 28 | 28 | ||
| 29 | libdl.a: $(SOURCES) | 29 | libdl.a: $(SOURCES) |
| 30 | $(CC) $(CFLAGS) -c $^ | 30 | $(CC) $(CFLAGS) -o $(^:%.c=%.o) -c $^ |
| 31 | $(AR) cru $@ $(SOURCES:%.c=%.o) | 31 | $(AR) cru $@ $(SOURCES:%.c=%.o) |
| 32 | $(RANLIB) $@ | 32 | $(RANLIB) $@ |
| 33 | 33 | ||
| @@ -58,19 +58,19 @@ lib-install: | |||
| 58 | 58 | ||
| 59 | install: $(INSTALL) | 59 | install: $(INSTALL) |
| 60 | 60 | ||
| 61 | test.exe: test.c $(TARGETS) | 61 | test.exe: tests/test.c $(TARGETS) |
| 62 | $(CC) $(CFLAGS) -o $@ $< libdl.dll.a | 62 | $(CC) $(CFLAGS) -o $@ $< libdl.dll.a |
| 63 | 63 | ||
| 64 | test-static.exe: test.c $(TARGETS) | 64 | test-static.exe: tests/test.c $(TARGETS) |
| 65 | $(CC) $(CFLAGS) -o $@ $< libdl.a | 65 | $(CC) $(CFLAGS) -o $@ $< libdl.a |
| 66 | 66 | ||
| 67 | testdll.dll: testdll.c | 67 | testdll.dll: tests/testdll.c |
| 68 | $(CC) $(CFLAGS) -shared -o $@ $^ | 68 | $(CC) $(CFLAGS) -shared -o $@ $^ |
| 69 | 69 | ||
| 70 | testdll2.dll: testdll2.c $(TARGETS) | 70 | testdll2.dll: tests/testdll2.c $(TARGETS) |
| 71 | $(CC) $(CFLAGS) -shared -o $@ $< -L. -ldl | 71 | $(CC) $(CFLAGS) -shared -o $@ $< -L. -ldl |
| 72 | 72 | ||
| 73 | testdll3.dll: testdll3.c | 73 | testdll3.dll: tests/testdll3.c |
| 74 | $(CC) -shared -o $@ $^ | 74 | $(CC) -shared -o $@ $^ |
| 75 | 75 | ||
| 76 | test: $(TARGETS) $(TESTS) testdll.dll testdll2.dll testdll3.dll | 76 | test: $(TARGETS) $(TESTS) testdll.dll testdll2.dll testdll3.dll |
| @@ -78,7 +78,7 @@ test: $(TARGETS) $(TESTS) testdll.dll testdll2.dll testdll3.dll | |||
| 78 | 78 | ||
| 79 | clean:: | 79 | clean:: |
| 80 | rm -f \ | 80 | rm -f \ |
| 81 | dlfcn.o \ | 81 | src/dlfcn.o \ |
| 82 | libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp \ | 82 | libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp \ |
| 83 | tmptest.c tmptest.dll \ | 83 | tmptest.c tmptest.dll \ |
| 84 | test.exe test-static.exe testdll.dll testdll2.dll testdll3.dll | 84 | test.exe test-static.exe testdll.dll testdll2.dll testdll3.dll |
