Makefile

changeset 37
1a67185e5496
parent 35
abaf2489c549
child 39
ac35daceb24c
equal deleted inserted replaced
36:be60c22cddfe 37:1a67185e5496
24 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 # POSSIBILITY OF SUCH DAMAGE. 26 # POSSIBILITY OF SUCH DAMAGE.
27 # 27 #
28 28
29 include conf.mk 29 # available configs: gcc, clang
30 CONF=gcc
30 31
31 all: clean compile 32 include $(CONF).mk
33
34
35 SRC = c2html.c
36 SRC += codegens.c
37 SRC += ccodegen.c
38 SRC += javacodegen.c
39
40 OBJ = $(SRC:%.c=build/%$(OBJ_EXT))
41
42 all: build build/$(BIN)
32 43
33 compile: build 44 build/$(BIN): $(OBJ)
34 cd src; $(MAKE) 45 $(LD) -o $@ $^ $(LDFLAGS)
35 46
47 build/%$(OBJ_EXT): src/%.c
48 $(CC) -o $@ $(CFLAGS) -c $<
49
36 build: 50 build:
37 $(MKDIR) build 51 $(MKDIR) build
38 52
39 test: compile 53 test: build/$(BIN)
40 ./build/$(BIN) test/ctestfile.c -o build/ctest.html \ 54 ./build/$(BIN) test/ctestfile.c -o build/ctest.html \
41 -H test/header.html -F test/footer.html 55 -H test/header.html -F test/footer.html
42 ./build/$(BIN) -j test/javatestfile.java -o build/javatest.html \ 56 ./build/$(BIN) -j test/javatestfile.java -o build/javatest.html \
43 -H test/jheader.html -F test/footer.html 57 -H test/jheader.html -F test/footer.html
44 ./build/$(BIN) test/bigtestfile.c -o build/bigtest.html \ 58 ./build/$(BIN) test/bigtestfile.c -o build/bigtest.html \
45 -H test/header.html -F test/footer.html 59 -H test/header.html -F test/footer.html
46 ./build/$(BIN) -p test/plain.csp -o build/plain.html \ 60 ./build/$(BIN) -p test/plain.csp -o build/plain.html \
47 -H test/header.html -F test/footer.html 61 -H test/header.html -F test/footer.html
48 clean: 62 clean:
49 $(RM) -f -R build 63 $(RM) $(RMFLAGS) build

mercurial