forked from ngageoint/csm
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile.win32
33 lines (26 loc) · 904 Bytes
/
Makefile.win32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
include Makefile
CC=./scripts/mscc
LD=./scripts/mslink
CDEBUGFLAGS=-O2
COPTS=/nologo $(CDEBUGFLAGS) /Zm800 /MD /GR /W1 /EHa $(DEFINES)
DEFINES=-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE
LDOPTS=/TP /nologo /GR -DWIN32 /GX
LIBNAME=csmapi
LIBRARY=$(LIBNAME).dll
INSTDIR=$(PWD)/win32
# warning -- this target does not work because it ends up running the linker command from Makefile
# instead make 'csmapi.dll'
all: $(LIBRARY)
%.o: %.cpp
$(CC) -c $(COPTS) $< -Fo$@
%.o: %.cc
$(CC) -c $(COPTS) $< -Fo$@
$(LIBRARY): $(OBJS)
./scripts/objects_to_def -dir . -proj $(@:%.dll=%) > $(@:%.dll=%.ldf)
$(LD) $(COPTS) $(LDOPTS) /DEF:$(@:%.dll=%.ldf) -o $@ $^
install::
$(RM) $(INSTDIR)/lib/$(LIBNAME).so
$(CP) $(LIBRARY:%.dll=%.lib) $(INSTDIR)/lib
$(CP) $(HEADERS) $(INSTDIR)/include/csm
clean::
$(RM) $(LIBRARY).manifest $(LIBRARY:%.dll=%.ldf) $(LIBRARY:%.dll=%.lib) $(LIBRARY:%.dll=%.exp)