Unlike that other summer “Max,” this one doesn’t bear the descriptive adjective in the title, but it’s pretty “Mad” too—not necessarily in the sense of “angry” (though the title canine is certainly out of sorts) but certainly in terms of being “wacky.” A very peculiar sort of patriotic family film, it mixes a boy-and-his-dog tale with action-movie violence in a way that would be weird even if it were well executed—which it isn’t. The result is one strange beast for the coming Fourth of July.

A set-up in Afghanistan shows Max, a Belgian Malinois, acting as a forward scout for an American squad, sniffing out caches of explosives and forewarning of ambushes. His handler is straight-arrow Kyle Wincott (Robbie Arnell), who on his off time skypes back to his South Texas family—daddy Ray (Thomas Haden Church), a stern but loving guy nursing a bad leg from service in Kuwait; mom Pamela (Lauren Graham), a sweet homebody; and surly younger brother Justin (Josh Wiggins), who spends his time alternately playing video games and making bootleg copies of them for neighborhood tough guy Emilio (Joseph Julian Soria) to sell. Emilio is also the cousin of Justin’s best friend Chuy (Dejon LaQuake), with whom he spends time out on the popular bike track, where Chuy introduces him to his pretty visiting cousin Carmen (Mia Xitlali).

But tragedy strikes the Wincott clan when Kyle is killed in an ambush that his supposed pal Tyler (Luke Kleintank) leads the squad into despite Max’s warning of danger ahead. The two men’s friendship had already become strained when it came to light that Tyler appeared to have absconded with some of the enemy arms they had previously uncovered; now Max, suffering the loss of his master, turns ferociously on Tyler and is sent back to the states, his doggie trauma leaving him unfit for further field duty.

When Max is brought to Kyle’s funeral and calms down only when at the foot of his master’s coffin—or when on a leash held by Justin, whom he recognizes as Kyle’s brother—Ray and Pamela decide that in order to save the animal from being put down, they’ll adopt him. Justin becomes Max’s initially reluctant new master, growing more interested in his new role when it turns out that Carmen, on whom he’s been sweet since their first meeting, is great with dogs and more than happy to help him get Max in hand despite the pooch’s habit of barking all night, his unease with most humans and the absolute frenzy he goes into at loud noises, like the Fourth of July fireworks.

At this point it seems that “Max” will be a standard-issue coming-of-age story centered on bonding between a troubled young boy and an equally troubled canine, with a smidgen of teen puppy-love mixed in for good measure. It remains that, but in mid-stream the script veers off in another direction. Tyler returns home early, and when Max immediately turns on him, lies to the Wincotts that the dog was responsible for Kyle’s death. He also weasels his way into a job at Ray’s storage facility, where he uses one of the units to hide the pilfered weaponry (somehow smuggled into the U.S.) that he, Emilio and a crooked deputy (Owen Harn) plan to sell to Mexican drug lords. And when Justin finds out what he’s doing, Tyler threatens him and his family while making sure that Ray sends Max off to be dealt with by the authorities.

This turns the last reels of the movie into a youthful action piece in which Justin, Chuy and Carmen—along with Max, who’s escaped animal control—join forces to rescue Ray, whom Tyler and his cohorts have taken captive, and foil their dastardly plot. That requires lots of physical derring-do—on bikes, in rivers, along cliffs, on railroad tracks—for the kids, some payback from Ray, and a good deal of dog-on-dog tussling for Max, who has already taken take of one Rottweiler and must now confront another. It all ends up with explosions, bullets flying and even rockets going off, though the youngsters in the heat of things aren’t injured—no thanks to Tyler, who becomes murderous in his frustration and gets what he deserves.

Truth to tell, this final conflagration comes across as entirely too much for a movie ostensibly directed to family audiences. Perhaps writer-director Boaz Yakin was hoping to recapture the feel of what’s still his best film, “Fresh” (1994), which also featured a young boy in peril. But in that case he got the balance right; here the last act literally goes off the rails. It may be that the excess is due to co-writer Sheldon Lettich, whose resume includes plenty of adult-oriented action fare, including “Rambo III” and a slew of Jean-Claude Van Damme vehicles; but whatever the case, the turn is tonally jarring, and some parents may find that it goes too far, especially for younger kids.

Among the cast, Church does his usual reliable work, and Wiggins is an agreeable presence, though he doesn’t evince the same degree of intensity he did in the superior “Hellion.” (He does, however, get to show off once again, as he did in the earlier film, his skill on wheels.) Xitlali comes on a bit strong, but is pleasant when she calms down; and LaQuake follows the same pattern, though he calms down much less often. Graham, Arnell, Harn and Soria, however, are amateurish, though Kleintank makes a properly hissable villain. The best performances certainly come from the canines—the six Belgian Malinois who together play Max, and the five Rottweilers that act his two opponents. Kudos to trainer Max Forbes. Stefan Czapsky’s cinematography, Bill Pankow’s editing and Kalina Ivanov’s production design are more than adequate, though Trevor Rabin’s music goes for the jugular too often.

With its desire to honor service dogs—especially in an elaborate montage before the closing credits—“Max” clearly has its heart in the right place. Its head is another matter.