forked from nir9/lightwm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (44 loc) · 1.66 KB
/
Makefile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
CC = cl
LINKER = link
RC = rc
CFLAGS = /W3
DBGCFLAGS = $(CFLAGS) /DDEBUG /Zi /W3 # temporarly not Wall
RELCFLAGS = $(CFLAGS) /Ox
EXE_SRCS = wm.c tiling.c error.c config.c keyboard.c
DLL_SRCS = wm_dll.c error.c
RES_FILE = wm_resources.rc
DBGDIR = debug
RELDIR = release
EXE_NAME = lightwm.exe
DLL_NAME = lightwm_dll.dll
all: clean_old debug release
debug: prep resource wm.c
$(CC) $(DBGCFLAGS) $(EXE_SRCS) $(RES_FILE).res /link user32.lib shell32.lib ole32.lib shlwapi.lib /out:$(DBGDIR)/$(EXE_NAME)
$(CC) $(DBGCFLAGS) $(DLL_SRCS) /LD /link user32.lib /DEF:wm_dll.def /out:$(DBGDIR)/$(DLL_NAME)
release: prep resource wm.c
$(CC) $(RELCFLAGS) $(EXE_SRCS) $(RES_FILE).res /link user32.lib shell32.lib ole32.lib shlwapi.lib /out:$(RELDIR)/$(EXE_NAME)
$(CC) $(RELCFLAGS) $(DLL_SRCS) /LD /link user32.lib /DEF:wm_dll.def /out:$(RELDIR)/$(DLL_NAME)
resource: $(RES_FILE)
$(RC) /fo $(RES_FILE).res $(RES_FILE)
prep:
@echo off > temp.bat && \
echo IF NOT EXIST $(DBGDIR) mkdir $(DBGDIR) >> temp.bat && \
echo IF NOT EXIST $(RELDIR) mkdir $(RELDIR) >> temp.bat && \
temp.bat && \
del temp.bat
# Temporary for a couple of weeks
clean_old:
if exist wm.exe ( del wm.exe )
if exist wm_dll.dll ( del wm_dll.dll )
if exist lightwm.exe ( del lightwm.exe )
if exist lightwm_dll.dll ( del lightwm_dll.dll )
echo Old cleanup done
clean:
del *.obj *.exe *.dll *.lib *.exp *.ilk *.pdb *.res
@echo off > temp.bat && \
echo IF EXIST $(DBGDIR) del /S /Q $(DBGDIR) >> temp.bat && \
echo IF EXIST $(RELDIR) del /S /Q $(RELDIR) >> temp.bat && \
echo IF EXIST $(DBGDIR) rd /S /Q $(DBGDIR) >> temp.bat && \
echo IF EXIST $(RELDIR) rd /S /Q $(RELDIR) >> temp.bat && \
temp.bat && \
del temp.bat