Makefile

changeset 72
b533da8e7411
parent 69
ff56b28e2cdd
child 74
831928419249
equal deleted inserted replaced
71:d5af9261231d 72:b533da8e7411
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 # available configs: gcc, clang 29 include config.mk
30 CONF=gcc
31
32 include $(CONF).mk
33 30
34 SRC = frontend.c 31 SRC = frontend.c
35 SRC += c2html.c 32 SRC += c2html.c
36 SRC += highlighter.c 33 SRC += highlighter.c
37 34
38 OBJ = $(SRC:%.c=build/%$(OBJ_EXT)) 35 OBJ = $(SRC:%.c=build/%.o)
39 36
40 all: build build/c2html 37 all: build build/c2html
41 38
42 build/c2html: $(OBJ) 39 build/c2html: $(OBJ)
43 $(LD) -o $@ $^ $(LDFLAGS) 40 $(CC) -o $@ $^ $(LDFLAGS)
44 41
45 build/%$(OBJ_EXT): src/%.c 42 build/%.o: src/%.c
46 $(CC) -o $@ $(CFLAGS) -c $< 43 $(CC) -o $@ $(CFLAGS) -c $<
47 44
48 build: 45 build:
49 $(MKDIR) $@ 46 $(MKDIR) $@
50 47
51 test: all 48 check: all
52 cd test && $(MAKE) 49 cd test && $(MAKE)
53 50
54 clean: 51 clean:
55 $(RM) $(RMFLAGS) build 52 $(RMDIR) build

mercurial