forked from gridlab-d/gridlab-d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
automake.bat
48 lines (35 loc) · 796 Bytes
/
automake.bat
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
@echo off
echo # generated by automake
echo+
for /F "delims=;" %%I in (makefile.win) do set %%I
if not exist %OUTDIR% mkdir %OUTDIR%
set OFILES=%CFILES:.c=.o% %CPPFILES:.cpp=.o%
set ALL=
for %%I in (%TARGETS%) do set ALL=%ALL% %OUTDIR%\%%I
echo all: %ALL%
echo+
echo clean:
echo+ del %OUTDIR%\%TARGETS% %OUTDIR%\%OFILES%
echo+
for %%I in (%TARGETS%) do (call :link %OUTDIR%\%%I)
for %%I in (%CFILES%) do call :c %%~nI
for %%I in (%CPPFILES%) do call :cpp %%~nI
goto :EOF
:c
set file=%1%
echo %file%.o: %file%.c
echo+ %gcc% %CFLAGS% -c %file%.c -o %file%.o
echo+
goto :EOF
:cpp
set file=%1%
echo %file%.o: %file%.cpp
echo+ %gcc% %CPPFLAGS% -c %file%.cpp -o %file%.o
echo+
goto :EOF
:link
set file=%*%
echo %file%: %OFILES%
echo+ %gcc% %LFLAGS% %OFILES% -o %file%
echo+
goto :EOF